Creating a module using NetBeans
Now that you've learned how to create, compile, and execute a module using the Command Prompt
, let's see how to do the same thing using the NetBeans IDE:
- Create a new project in the NetBeans IDE by clicking in the toolbar or, through the menu
File
|New Project
, you'll see aNew Project
overlay with a new option in theJava
category--Java Modular Project
:

- Select that and click
Next
. In the next dialog, you can specify the name of your project (I choseaddressbookviewer
) and the location of your project and clickFinish
:

- Once the new project is loaded onto your IDE, you can right-click on the name of the project in the
Projects
tab and choose the option to create a new module:

- In the
New Module
dialog, enter the name of the modulepackt.addressbook
and clickFinish
:

And just like that, you've created a new module! Note how NetBeans has automatically created the module descriptor for your module:

- Now what's left is to add the
Main.java
class by right-clicking on...