-
Notifications
You must be signed in to change notification settings - Fork 40.8k
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 1.5.x
.
Note
|
Java 10 is supported as of Spring Boot 2.0.1.RELEASE . We intend to support Java 11 as of Spring Boot 2.1.x
|
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:
java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException
Hibernate typically requires JAXB that’s no longer provided by default. You either need to add a dependency to your project:
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
</dependency>
Or you could add the java.xml.bind
module to restore this functionality with Java9.
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](https://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#howto-customize-dependency-versions) if necessary.
These libraries do not have full support for Java 9 yet:
-
Apache Cassandra, see #10453