Reputation: 7709
I tried to create a maven webapp project in Intellij, it creates the maven folder structure like this:
-src
---main
------resources
------webapp
But it does not create the "java" folder. If i try to create it manually, when i right click the Java folder it does not give me the option "new Class" or "new package", just "new file" or "new folder".
How to make the IDE understand the folder as a java folder?
Upvotes: 19
Views: 10129
Reputation: 9709
If it didn't create java directory, perhaps you didn't chose to create a java maven application when you opened/imported directory with project to idea. Anyways maven's structure is determined and java sources should be in java folder. You have to create a folder manually and mark it as java sources. Go to project settings(alt+ctrl+shift+s) -> Modules -> check your module in sources find your folder and Mark as Sources
Upvotes: 2
Reputation: 40438
You need to right click the java
folder and choose the option:
Mark Directory As
-> Source Root
Upvotes: 42