Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Spring Boot with Java 9 and above
This page gathers the things that you need to know if you want to run Spring Boot apps on Java 9 and above.
Spring Boot 2 is the first version to support Java 9 (Java 8 is also supported). If you are using 1.5 and wish to use Java 9 you should upgrade to 2.0 as we have no plans to support Java 9 on Spring Boot
Java 10 is supported as of Spring Boot
With Java 9, if you need to weave classes from the JDK, you need to use AspectJ 1.9. Spring AOP should work fine in most cases with AspectJ 1.8 (the default in Spring Boot 2.0).
When upgrading you may face the following:
Hibernate typically requires JAXB that’s no longer provided by default. You can add the
java.xml.bind module to restore this functionality with Java9 or Java10 (even if the module is deprecated).
As of Java11, the module is not available so your only option is to add the JAXB RI (you can do that as of Java9 in place of adding the
<dependency> <groupId>org.glassfish.jaxb</groupId> <artifactId>jaxb-runtime</artifactId> </dependency>
If you are using lombok, the managed version of Spring Boot may not work with the latest JDK. Check the Lombok web site and override its version if necessary.
Reflection APIs and WildFly
When deployed as a WAR application on WildFly, Spring Boot applications might require some advanced JDK reflection API for proxying, included in the
sun.reflect package. For that, your application needs to list
jdk.unsupported as a Dependency in its
MANIFEST.MF file (see the WildFly wiki about this).
These libraries do not have full support for Java 9 yet:
Apache Cassandra, see #10453