Java Magazine, September/October 2017
ORACLE COM JAVAMAGAZINE SEPTEMBER OCTOBER 2017 20 java 9 APIs are truly encapsulated and hidden from apps using the platform This can make migrating legacy code to modularized Java 9 problematic if your code depends on internal APIs Improved performance The JVM uses various optimization techniques to improve application performance JSR 376 indicates that these techniques are more efective when its known in advance that required types are located only in specific modules Listing the JDKs Modules A crucial aspect of Java 9 is dividing the JDK into modules to support various configurations Consult JEP 200 The Modular JDK All the Java modularity JEPs and JSRs are shown in Table 1 Using the java command from the JDKs bin folder with the list modules option as in java list modules lists the JDKs set of modules which includes the standard modules that implement the Java Language SE Specification names starting with java JavaFX modules names starting with javafx JDK specific modules names starting with jdk and Oracle specific modules names starting with oracle Each module name is followed by a version string@ 9 indicates that the module belongs to Java 9 Module Declarations As we mentioned a module must provide a module descriptor metadata that specifies the modules dependencies the packages the module makes available to other modules and more A module descriptor JEP 200 THE MODULAR JDK JEP 201 MODULAR SOURCE CODE JEP 220 MODULAR RUN TIME IMAGES JEP 260 ENCAPSULATE MOST INTERNAL APIS JEP 261 MODULE SYSTEM JEP 275 MODULAR JAVA APPLICATION PACKAGING JEP 282 JLINK THE JAVA LINKER JSR 376 JAVA PLATFORM MODULE SYSTEM JSR 379 JAVA SE 9 is the compiled version of a module declaration thats defined in a file named module info java Each module declaration begins with the keyword module Table 1 Java Modularity JEPs and JSRs
You must have JavaScript enabled to view digital editions.