IntelliJ IDEA 2017.1 supports the modular features of Java9 (Project Jigsaw). In this version, the module file also supports code completion based on specific names and keywords, and you can quickly refine the modular code in your project.

So let’s take a look at what modular engineering is. First, we create a common module project IntelliJ IDEA module which contains the great “Hello World” that changes the World.

IntelliJ IDEA will guide you to create a module-info.java for your module in the project

Module-info.java will provide you with a basic module code structure.

All listen to command, the party will guide you the right path! At this point, when you’re using a Java class the way it used to be, you’ll see a new posture with modularity.

Here, IntelliJ IDEA helps you figure out what’s wrong and suggest fixes.

As you might expect, IntelliJ IDEA makes the correct changes to the module-info.java file after doing this.

Of course, you can also try to edit the module-info.java file yourself. IDEA will give you complete completion and prompt information.

Quick fixes are not only available for standard Java modules, but also help you write your own module code. If you try to access code in another IntelliJ IDEA module to use modularity features from within a module (as prompted in the module-info.java file), IntelliJ IDEA will tell you that it won’t work if you haven’t made the correct changes.

First, there are plenty of hints to help you with the changes, so once there are Java files in the module where the module-info.java file resides, you can quickly complete the package paths that follow.

Go back to the class of the imported module and use Alt and Enter to get the Fix suggestion. Firstly, module one depends on module two. Once this is done, the module-info.java file for module one can be associated with module two.

Firstly, the IntelliJ IDEA modules you are probably familiar with. And secondly, the new Java 9 (Jigsaw) module is specified to use module-info.java. To use the Java modularity feature, each Java 9 module needs to correspond to the IntelliJ IDEA module. Also note (as shown in the last example in IntelliJ IDEA 2017.1) that you need to declare IntelliJ IDEA module dependencies as well as Java 9 module dependencies. So in the last example, module one depends on module two:

But in the module-info.java file you also need to declare that it is associated with module two:

Original text: blog.jetbrains.com/idea/2017/0…