How to Migrate a Spring Boot Application to Java 11: Step‑by‑Step Guide

This article explains why migrating a Spring Boot app from Java 8 to Java 11 is necessary, compares OpenJDK and commercial licenses, outlines Spring's Java‑11 support, and provides detailed migration steps, dependency updates, and Maven/Gradle configuration changes.

Programmer DD
Programmer DD
Programmer DD
How to Migrate a Spring Boot Application to Java 11: Step‑by‑Step Guide

Java Release Cycle

Oracle releases a new Java version every six months and an LTS (Long‑Term Support) version every three years; Java 11 is the current LTS, offering three years of commercial production support.

Commercial vs OpenJDK

Several vendors provide OpenJDK builds (IBM, RedHat, Azul) that are free under the GPL. Oracle also offers OpenJDK builds. Commercial Oracle JDK includes paid support and a subscription model, while OpenJDK can be used freely in production, though updates depend on the vendor.

Licensing Differences

Oracle’s traditional perpetual license requires an upfront cost plus annual support fees, whereas the subscription bundles license, updates, and support for a single price, payable for the needed duration.

Impact of Containers and Cloud

Each desktop or server/CPU can subscribe to Java SE; pricing models help evaluate cost impact when running on containers or cloud platforms.

Oracle License Pricing

Oracle publishes a price list; organizations that cannot follow the six‑month release cadence should budget accordingly, as running JDK on multi‑core processors can become expensive.

Spring’s Support for JDK 11

Spring Framework 5.1 added Java 11 support (Spring 4.3 supports up to Java 8, 5.0 supports Java 9, 5.1 supports Java 11). Spring Boot 2.1.x supports Java 11, and Spring Boot 2.2 will support Java 12. Migration from Spring Boot 1.5.x to 2.1.1 with Java 11 compiled code is smooth with minor project changes.

When using PaaS solutions such as Pivotal or Cloud Foundry, additional considerations apply for Spring Boot 2.x deployments.

Additional Dependencies and Project Changes

Java 11 externalizes many libraries (JAXB, JAX‑WS, JTA, etc.); these must be added explicitly to the Maven POM. Projects using these J2EE modules need to declare the dependencies and rebuild.

If using Eclipse, install Eclipse Photon (4.9) and the Java 11 plugin.

Update <java.version> in Maven POM to 11 or set sourceCompatibility to 11 in Gradle.

Upgrade the Maven Compiler Plugin to version >3.5 (e.g., 3.8.0) or use Gradle 5.x.

Replace Cobertura with JaCoCo for coverage, as Cobertura is no longer supported.

Update Maven Surefire and Failsafe plugins and configure --illegal-access=permit flags.

Address illegal reflective access warnings that appear on Java 11.

Enable TLS 1.3 support, which Java 11 provides.

Update bytecode manipulation libraries (ASM, CGLIB, Byte Buddy, Javassist) to versions compatible with Java 11.

WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by j9ms.internal.JPEG (file:...) to field com.sun.imageio.plugins.jpeg.JPEG.TEM
WARNING: Please consider reporting this to the maintainers of j9ms.internal.JPEG
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
# here's the reflective access to the static field com.sun.imageio.plugins.jpeg.JPEG.TEM

Modularization: you can create a custom JRE image to reduce memory footprint and improve performance.

<!-- Added for JAVA 11 Support START-->
<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-compiler-plugin</artifactId>
  <version>3.8.0</version>
  <configuration>
    <release>11</release>
  </configuration>
  <dependencies>
    <dependency>
      <groupId>org.ow2.asm</groupId>
      <artifactId>asm</artifactId>
      <version>6.2</version>
    </dependency>
  </dependencies>
</plugin>
<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-surefire-plugin</artifactId>
  <configuration>
    <argLine>--illegal-access=permit</argLine>
  </configuration>
</plugin>
<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-failsafe-plugin</artifactId>
  <configuration>
    <argLine>--illegal-access=permit</argLine>
  </configuration>
</plugin>
<!-- Added for JAVA 11 Support END-->

Conclusion

Oracle accelerates Java’s release cadence, and OpenJDK remains free for production use. However, if your framework or product does not support Java 9+, using OpenJDK 9+ may not be viable for production.

The focus of this guide is migrating a Spring‑Boot Maven project to Java 11; other aspects such as security, JVM performance, certificates, and cloud readiness are beyond its scope.

Additional Resources

Oracle Java SE Support Roadmap

Oracle Java SE Subscription FAQ

Spring Boot with Java 9+ Wiki

Java Client Roadmap Update (PDF)

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

BackendmigrationmavenSpring BootOpenJDKJava 11
Programmer DD
Written by

Programmer DD

A tinkering programmer and author of "Spring Cloud Microservices in Action"

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.