IntelliJ IDEA 13.1 Web Help

Java modules let you develop Java SE and Java EE applications. The core functionality provided by a Java module can be extended by adding support for various technologies and frameworks. In IntelliJ IDEA these additional frameworks and technologies are represented by facets.

You can create a Java module when creating a project. You can also add a Java module to an existing project.

To create a Java module
  1. 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.

  2. On the first page of the wizard, in the left-hand pane, select Java. (There are also other options for creating a Java module, see Options for creating a Java module.)
  3. 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.)
  4. 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.

  5. 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.
  • 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).

See Also

Concepts:

Reference:

Web Resources: