B4J Question Java 10: -Xbootclasspath/p is no longer a supported option.

Jmu5667

Well-Known Member
Licensed User
Longtime User
Hello

Under Java 10 I get the following error:

C:\Users\Administrator\Desktop\Aspect Hello>java -Xbootclasspath/p:alpn-boot-8.1
.12.v20180117.jar -jar ies_svr_aspect_hello.jar
-Xbootclasspath/p is no longer a supported option.
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

What is the solution ?

Regards

John.
 

OliverA

Expert
Licensed User
Longtime User
Looks like since Java 9, some things are changing and will need to be changed on this end for proper support. See https://github.com/jetty-project/jetty-alpn/issues/15. A couple of quotes from that link:
Unfortunately you still need the bootclasspath for JDK 8 only, so it's not a completely transparent solution, as you have to change the command line depending on the JDK version.
Note that you may wish to consider using the conscrypt SSL provider with jetty. Not only is it much faster than native SSL, but it supports ALPN in both java8 and java9 without the need to modify the boot path.

https://www.eclipse.org/jetty/documentation/9.4.x/jetty-ssl-distribution.html
 
Upvote 0

Jmu5667

Well-Known Member
Licensed User
Longtime User
Upvote 0

OliverA

Expert
Licensed User
Longtime User
Looking at the MANIFEST.MF file included in the jetty_b4j.jar file included in B4J version 6.01, the Jetty version is 9.4.6.v20170531.

Quoting from https://webtide.com/getting-started-with-jetty-and-jdk-9/:
Jetty 9.4.6 only supports ALPN via the alpn-boot mechanism, which requires the alpn-boot jar to be in the bootclasspath.
Since Jetty 9.4.7, ALPN is also supported using JDK 9 specific APIs without the need of the alpn-boot mechanism. This only works when Jetty is run using JDK 9.
Since Jetty 9.4.8, ALPN is also supported via the Conscrypt provider, which binds natively to OpenSSL. This is supported for both JDK 8 and JDK 9.
The advantage of using the Conscrypt provider rather than the default JDK provider is increased performance and increased ease of configuration (since there is no need for the alpn-boot mechanism).

Given these two pieces of information, JDK9 and up and -Xbootclasspath/p:alpn-boot-8.1.12.v20180117.jar with the current included Jetty will not happen.

Please note that JDK8 is considered LTS (long term support), and JDK9 and JDK10 are not (http://www.oracle.com/technetwork/java/eol-135779.html). Oracle even says this about Java SE 9 and 10.
Java SE 9 will be a short term release, and users should immediately transition to the next release (18.3) when available. Java SE 10 (18.3) will be a short term release and users should transition to the next release when available.
The next LTS version will be 11, which is expected to be available in September 2018. So until the next LTS comes out, I would personally just stick with 8.
 
Upvote 0

Jmu5667

Well-Known Member
Licensed User
Longtime User
Looking at the MANIFEST.MF file included in the jetty_b4j.jar file included in B4J version 6.01, the Jetty version is 9.4.6.v20170531.

Quoting from https://webtide.com/getting-started-with-jetty-and-jdk-9/:


Given these two pieces of information, JDK9 and up and -Xbootclasspath/p:alpn-boot-8.1.12.v20180117.jar with the current included Jetty will not happen.

Please note that JDK8 is considered LTS (long term support), and JDK9 and JDK10 are not (http://www.oracle.com/technetwork/java/eol-135779.html). Oracle even says this about Java SE 9 and 10.

The next LTS version will be 11, which is expected to be available in September 2018. So until the next LTS comes out, I would personally just stick with 8.


Great piece of detective work, at least we know to stick with Java 8. Many thanks :)
 
Upvote 0
Top