With the release of Java 9 in late September, Java went modular, to improve scalability and performance and to let developers assemble custom configurations with just the functionality needed by an application. But the new Java Platform Module System features need development tools to really take advantage of them.
Here is where several key Java development tools stand in their modularity support.
Apache Ant: Ready for Java modularity
A Java library and command line tool used in building Java applications, Apache Ant is up to speed for Java 9 and modularity. The Ant project management committee has ensured Ant works on Java 9 with the February 2017 Ant 1.10.1 release. It supports module path and related options to the
Apache Maven: Ready for Java modularity
Version 3.7 of the Maven software build tool supports Java 9 and modularity.
However, “where it gets tricky is if you’re a library developer,” with dependencies needing to be modularized, said Brian Fox, a member of the Maven project management committee.
Eclipse IDE: Ready for Java modularity
The open source Eclipse IDE supports Java 9 as of June 2017’s Oxygen release. But to work with Java 9 modules, developers need to add the following vmargs (command-line parameters for the JVM) to eclipse.ini:
—add-modules=ALL-SYSTEM. A project might fail to run because types are being used that are neither in java.base or java.se.ee, such as types from javafx.base. In that case, you have to figure out which modules you need to add with
—add-modules, according to the Eclipse documentation.
Gradle: Not ready for Java modularity
The Gradle software build tool doesn’t fully support Java 9 yet, though its developers expect it to do so in 2018.
In the meantime, Gradle-using developers can experiment with modularity through workarounds. You can produce modules for Java libraries and consume them as dependencies. (A feature of the module system in Java 9 is developers can convert all project libraries to Java 9 modules in a bottom-up fashion.) “Because Java 9 module jars can be consumed equally well from the classpath or the module path, we can convert a single leaf-node in our multiproject build to produce a Java 9 module, but use that module .jar on the classpath when compiling or running projects which consume the outputs of that node,” the Gradle documentation states.
Jenkins: Not ready for Java modularity
The Jenkins open source automation server used in continuous integration and deployment for software development projects doesn’t yet support Java 9 modularity remain a work in progress.
CloudBees is leading the effort in the Jenkins community to make Jenkins Java 9-compatible, said project founder Kohsuke Kawaguchi, CTO at CloudBees. But he has no estimated date for delivering Java 9 compatibility to Jenkins.
JetBrains IntelliJ Idea IDE: Ready for Java modularity
As of version 2017.2, the popular IntelliJ Idea IDE has full support for Java modularity. Developers can build a Java 9 modular project, as in one that uses the module path instead of classpath. Also supported are development of
module-info.java files, as well as code completion and quick fixes for these files. Other support for modularity in IntelliJ Idea include:
- Quick fixes for Java code that uses modularity.
- Support for running and debugging using the module path.
- Generation of module diagrams to help visualize of the JDK and custom and automatic modules.
This story, “Which tools support Java 9’s new modularity features” was originally published by InfoWorld.