Intellij IDEA不提供用于创建的“新类” [英] Intellij IDEA don't offer 'new Class' for creating

查看:226
本文介绍了Intellij IDEA不提供用于创建的“新类”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有Maven项目,当我想创建新课程时,它不在报价中。只有新文件。还有包裹不可用,而是有目录。

I have Maven project and when I want to create new class, it isn't in an offer. There is only new File. Also packages aren't available but instead of them, there are directories.

我应该打开什么?

编辑

我有IDEA 12,这是来自不同项目的截图。

I have IDEA 12, here is screenshots from different projects.

项目1 - 正确:

Project 1 - correct:

项目2 - 错误

Project 2 - incorrect

推荐答案

新的/ Class和New / Package操作仅在源根目录中可用。如果您选择了一个项目文件夹,或者某个子文件夹不在src根目录中,那么您将无法在那里创建类

New/Class and New/Package actions are only available within source roots. If you have a project folder selected, or some subfolder that is not within a src root, you won't be able to create classes there

这篇关于Intellij IDEA不提供用于创建的“新类”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆