Java 11 Migration Guide: Release Cycle, LTS, Tool Updates, JPMS Migration, and Compatibility Issues
This guide explains the Java 11 migration process, covering the new JDK release schedule, LTS support, OpenJDK and Amazon Corretto adoption, required tool upgrades, JPMS module changes, class‑loader differences, obsolete JVM options, and common framework compatibility problems.
Background
Discusses the new JDK release cycle, OpenJDK feature standardization, and long‑term support (LTS) versions.
New Release Cycle
Major releases occur every six months (March and September) with two minor updates following each major release.
OpenJDK as the Standard JDK
Since September 2018 OpenJDK and Oracle JDK are functionally identical; OpenJDK 11 is maintained by the Red Hat community, providing reliable production support.
LTS Versions
Commercial JDK vendors define LTS at versions 11, 17, 23, etc. OpenJDK guarantees at least four years of maintenance for these releases, with binaries available from AdoptOpenJDK.
Amazon Corretto
Amazon offers its own OpenJDK distribution (Corretto) under GPL+CE, adding security, performance, and stability fixes, supporting Linux, macOS, and Windows, with LTS for Java 8 until 2023 and Java 11 until 2024, and quarterly updates.
Preparing Migration
1. Update Development and Build Tools
IntelliJ IDEA 2018.2
Eclipse Photon 4.9RC2 with Java 11 plugin
Maven 3.5.0
Maven compiler plugin 3.8.0
Surefire and failsafe 2.22.0
Gradle 5.0
Replace discontinued tools: FindBugs → SpotBugs, Cobertura → JaCoCo.
Upgrade bytecode‑related libraries (ASM 7.0, Byte Buddy 1.9.0, cglib 3.2.8, Javassist 3.23.1‑GA) and frameworks (Spring ≥5.1, Mockito ≥2.20.0).
2. JPMS Migration
2.1 Java EE modules removed
Compilation fails when using removed packages, e.g.:
error: package javax.xml.bind does not exist
import javax.xml.bind.JAXBException;Runtime error example:
Exception in thread "main" java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException
at monitor.Main.main(Main.java:27)Required Maven dependencies:
<dependency>
<groupId>com.sun.activation</groupId>
<artifactId>javax.activation</artifactId>
<version>1.2.0</version>
</dependency> <dependency>
<groupId>javax.transaction</groupId>
<artifactId>javax.transaction-api</artifactId>
<version>1.2</version>
</dependency> <dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.2.8</version>
</dependency>
... (additional JAXB and JAX‑WS dependencies) ...2.2 Module visibility and internal API access
Use --add-exports to export non‑public packages and --add-opens to open them for deep reflection. Example:
javac --add-exports java.desktop/com.sun.imageio.plugins.jpeg=ALL-UNNAMEDRun with:
java --add-exports java.desktop/com.sun.imageio.plugins.jpeg=ALL-UNNAMED \
--add-opens java.desktop/com.sun.imageio.plugins.jpeg=ALL-UNNAMEDControl illegal‑access warnings with --illegal-access=permit|warn|debug|deny .
2.3 Detecting internal APIs with jdeps
jdeps --jdk-internals -R --class-path 'libs/*' $projectSample output shows replacements such as sun.misc.BASE64Encoder → java.util.Base64 and sun.reflect.Reflection → java.lang.StackWalker .
2.4 ClassLoader changes
JDK 8 uses bootstrap, extension, and application classloaders; JDK 9+ replaces the extension loader with a platform loader and the application loader is no longer a URLClassLoader . Dynamic loading must use a custom java.security.SecureClassLoader instead of casting to URLClassLoader .
String pathSeparator = System.getProperty("path.separator");
String[] classPathEntries = System.getProperty("java.class.path").split(pathSeparator);2.5 Obsolete JVM options
Options are categorized as Obsolete (accepted but ignored), Deprecated (accepted with warning), and Removed (causes error). References to official Java documentation are provided.
Framework Compatibility Issues
OpenJDK 11 incompatibility with Spring Cloud Finchley (see linked article).
Lombok compilation errors – upgrade to Lombok 1.18.+.
Spring Cloud Hystrix ThreadPool bug.
Selected Java Interview Questions
A professional Java tech channel sharing common knowledge to help developers fill gaps. Follow us!
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.