Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create "java" folder into a maven webapp project in Intellij?

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?

like image 767
Mateus Viccari Avatar asked Oct 30 '14 12:10

Mateus Viccari


People also ask

How do I create a webapp folder in IntelliJ?

Create a new web applicationClick New Project on the Welcome screen or select File | New | Project. From the Generators list, select Jakarta EE. Name the new project, select a build tool, a language you want to use, and select the Web application project template.

How do I create a project Maven project in IntelliJ?

In the Project tool window, right-click your project and select Add Framework Support. In the dialog that opens, select Maven from the options on the left and click OK. IntelliJ IDEA adds a default POM to the project and generates the standard Maven layout in Project tool window.

How do I run a Web application in IntelliJ?

IntelliJ IDEA needs a run configuration to build the artifact and deploy it to your application server. From the main menu, select Run | Edit Configurations. , expand the Glassfish Server node, and select Local. Fix any warnings that appear at the bottom of the run configuration settings dialog.


1 Answers

You need to right click the java folder and choose the option:

Mark Directory As -> Source Root

like image 199
vikingsteve Avatar answered Sep 24 '22 07:09

vikingsteve