misco
misco

Reputation: 1952

Intellij IDEA don't offer 'new Class' for creating

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.

What I should turn on?

Edit:

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

Project 1 - correct: enter image description here

Project 2 - incorrect enter image description here

Upvotes: 2

Views: 1850

Answers (4)

TaoJiaju
TaoJiaju

Reputation: 11

If you set mark the folder as source root, the color is turned to be blue and now you can right click the folder to add your packages. Click the link to see the snapshot. https://i.sstatic.net/CTFS0.jpg

Upvotes: 1

sank
sank

Reputation: 11

Mark your directory as Source root and your problem is solved

Upvotes: 1

lena
lena

Reputation: 93868

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

Upvotes: 4

duffymo
duffymo

Reputation: 309008

Wrong. IntelliJ 12 does allow you create new classes. Under File->New you'll see Java Class, Package, all the usual suspects.

I don't see what Maven has to do with this at all.

Upvotes: 0

Related Questions