-
Do one of the following:
-
If you are going to create a new project:
click Create New Project on the Welcome screen or
select File | New Project.
As a result, the New Project wizard opens.
-
If you are going to add a module to an existing project:
open the project you want to add a module to, and
select File | New Module.
As a result, the New Module wizard opens.
-
If you are going to create a new project:
click Create New Project on the Welcome screen or
select File | New Project.
- On the first page of the wizard, in the left-hand pane, select Java Module. (There are also other options for creating a Java module, see Options for creating a Java module.)
- In the right-hand part of the page, specify the associated settings and click Next. (See the descriptions of the settings for a new project or for an existing project.)
-
On the Technologies page of the wizard,
select the technologies and frameworks to be supported in your module.
If necessary, also select an application server that you want to use to deploy and run your application.
As a result, you'll be able to download and configure the necessary framework components (e.g. implementation libraries). You will also have various descriptors, configuration files and sample code generated automatically, and the module dependencies properly configured.
- Click Finish.
Options for creating a Java module
When on the first page of the New Project or New Module wizard, you can select the following options to create a Java module:
- Java Module (under Java). An empty structure for developing a Java application will be created.
-
Command Line App (under Java).
The module will contain a class
with a main() method.
You'll be able to run this class
right away
by using a run/debug configuration which IntelliJ IDEA will also create.
-
JavaEE Web Module (under Java Enterprise).
In addition to what you normally get for a Java module, IntelliJ IDEA will create:
-
web\WEB-INF\web.xml
(the deployment descriptor
file). - web\index.jsp (a file which, with minor modifications, you can use as a starting page of your Web application).
- An artifact specification for your Web application.
-
web\WEB-INF\web.xml
(the deployment descriptor
-
Java Hello World (under Samples Gallery).
The module will contain a class
implementing a Hello World application.
You'll be able to run this application
right away
by using a run/debug configuration which IntelliJ IDEA will also create.
In all of the cases, you can expand the basic capabilities of your Java module on the next page of the wizard (the Technologies page).