Ashish Sinha
Ashish Sinha

Reputation: 51

Minimum Jetty version compatible with Java 11

What is the minimum jetty version compatible with Java11 ?

I am currently on Jetty6.1.3 that runs on Java7. I tried simply upgrading jre and related dependencies but its not working.

Upvotes: 4

Views: 9842

Answers (2)

Basil Bourque
Basil Bourque

Reputation: 339679

Eclipse Jetty

The Eclipse Jetty web site says that both Jetty 10 and 11 are built for Java 11 at a minimum.

Jetty Version Servlet API License Java
Jetty 9.4.x 3.1 JavaEE 8
javax.servlet.*
Java 8
Jetty 10.0.x 4.0 JavaEE 8
javax.servlet.*
Java 11+
Jetty 11.0.x 5.0 JakartaEE 9
jakartaee.servlet.*
Java 11+

Because of the transition from Oracle Corp to the Eclipse Foundation (Java EE becoming Jakarta EE), and the ensuing change in package names from javax.* to jakarta.*, the two Jetty versions 10 & 11 are functionally identical. The two versions are developed in parallel. The only significant difference is the package name.

Apache Tomcat

By the way, Apache Tomcat is doing the same, with parallel versions 9 and 10.0, both supporting 8+. They use the javax and jakarta package naming, respectively.

The next version of Tomcat, version 10.1.x requires Java 11+. This next version of Tomcat will support the next versions of Jakarta 10 technologies still under development, such as Servlet 6. See the Which version? page on Tomcat site.

Upgrade to Jetty 10 on Java 11

You may be able to do a direct upgrade by going to Jetty 10 on Java 11.

Upvotes: 5

Joakim Erdfelt
Joakim Erdfelt

Reputation: 49525

Depends on what you mean by "compatible with Java11"?

If you mean "it just works", then use Jetty 9.4.x series.

Being "compatible with Java11" can mean many things, not just the runtime, but also with regards to new features introduced around Java 9 (such as JEP 238, and MultiRelease JAR files).

For Jetty 9.4.x series, the bytecode scanning underwent a few iterations before it was compatible with java 11.

  1. on Jetty 9.4.9 the bytecode scanning had to ignore JPMS module-info.class content (when run on Java 8 runtime) found in 3rd party jar files at the time.
  2. on Jetty 9.4.9 the bytecode scanning had to ignore META-INF/versions/* content on Java 8 runtime.
  3. on Jetty 9.4.14 the bytecode scanning had to use META-INF/versions/* for bytecode scanning on Java 9+ runtime intelligently.
  4. on Jetty 9.4.14 the bytecode scanning had to be updated to support the new bytecode format (this means an ASM lib update)

See past answers on these topics

If you mean "uses Java 11 effectively", then use Jetty 10.0+

As always, keep your Jetty and JVM up to date. (Especially so if you use SSL/TLS, as things change very fast in that space)

Upvotes: 4

Related Questions