To Examples Page

Creating a Project with Multiple Modules

IntelliJ directions for creating project with multiple modules (see the Greeter Example).

  1. Open the IntelliJ IDE.
  2. In the Welcome to IntelliJ IDEA Dialog, click on the Create New Project Link.
  3. Create a Java Project named Greeter:
  4. Add a module named Greeter1 to the Greeter Project:
    1. Right click on the project name Greeter1. Select New >> Module.
    2. In the New Module Dialog, click Next. Enter the Module name as Greeter1. Click Finish.
  5. Add a class named Main to the Greeter1 Module:
    1. Right click on the src folder under the Greeter1 Module. Select New >> Java Class. In the Create New Class Dialog, enter Main as the name of the class. Replace the source code of this class with the code in Main.java.
    2. Create three more modules and classes for these modules according to this table:
      Module Name Classe Files for Modules
      Greeter2 Main.java
      Greeter3 Main.java   Greeter.java
      Greeter4 Greeter.java
    3. Run a main method in any of the modules by clicking the green arrow to the left of its header.