This guide shows how to use IntelliJ IDE to develop and run Java 9 Modules.
One way to add Java 9 modules in IntelliJ IDE is to use IntelliJ specific project modules. Intellij module is an independent and ordinary Java project. To use Java 9 modules, we need to use IntelliJ 1217.1 or later versions. The IDE added various support to develop Java 9 modules. Following video demonstrates how to use that.
The source code of the example project is same as the last example.
Module path
Following shows the output of the example main class:
D:\Java9\jdk-9\bin\java "-javaagent:D:\JetBrains\IntelliJ IDEA Community Edition 2017.2.4\lib\idea_rt.jar=56998:D:\JetBrains\IntelliJ IDEA Community Edition 2017.2.4\bin" -Dfile.encoding=UTF-8 -p D:\intellij-module-example\out\production\data.widget;D:\intellij-module-example\out\production\common.widgets -m data.widget/com.example.Component
Test Object
Above output shows how intelliJ sets -p (--module-path) and -m (--module) options. This output is taken form 'run' tool window.