A simple boilerplate project that combines Java 9 modules, gradle, IntelliJ settings and unit tests
- Install JDK 9 and gradle
- Clone this project, run
gradle idea
, open project in IntelliJ- Note: "calling gradle idea and using IDEA's importer are mutually exclusive" - if you run
gradle idea
, then don't use IntelliJ gradle importer
- Note: "calling gradle idea and using IDEA's importer are mutually exclusive" - if you run
- Take a look at the file structure:
tree .
gradle clean build run
gradle clean build test
-
To use Java 9 modularity, each Java 9 module needs to correspond to an IntelliJ IDEA module.
-
Jigsaw/Java 9 modules hello world:
-
Project structure with multiple modules and unit tests:
-
Gradle and Java 9 modules:
-
Switching between Java versions:
alias j9="export JAVA_HOME=`/usr/libexec/java_home -v 9`; java -version"
alias j8="export JAVA_HOME=`/usr/libexec/java_home -v 1.8`; java -version"