Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

java -xbootclass path is no longer a supported option

I upgrade the linux system and java package was also upgraded. I was running a jar file with command java -Xbootclasspath/p:b.jar -jar c.jar and now this error occurs:

-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.

like image 232
mahmoudadel Avatar asked Jun 14 '18 23:06

mahmoudadel


People also ask

What is removed in Java 11?

In JDK 11, the Java EE and CORBA modules were removed. These modules were deprecated for removal in JDK 9. The removed modules are: java.xml.ws: Java API for XML Web Services (JAX-WS), Web Services Metadata for the Java Platform, and SOAP with Attachments for Java (SAAJ)

Can Java 8 programs run on Java 11?

The class files created by Java 8 are still executable in Java 11; however, there have been other changes in the Java runtime (library changes, etc.) that might require modification of the code. These modifications may be made in Java 8 and compiled with Java 8 making it compatible with the Java 11 runtime.

Is Java still supported?

The end is near for Java 7, a nearly 11-year-old release of standard Java. Oracle is set to discontinue extended support for the platform at the end of July 2022. With the cessation of official Extended Support, Java 7 goes into Sustaining Support mode as defined by the Oracle Lifetime Support Policy.


2 Answers

JAVA 11 doesn't support -Xbootclasspath/p:, so your command should be changed from /p: to /a:.

Before:

java -noverify -Xbootclasspath/p:

After:

java -noverify -Xbootclasspath/a:
like image 53
Gandikota Saikoushik Avatar answered Oct 03 '22 08:10

Gandikota Saikoushik


From the Java 9 Release notes:

The boot class path has been mostly removed in this release. The java -Xbootclasspath and -Xbootclasspath/p options have been removed. The javac -bootclaspath option can only be used when compiling to JDK 8 or older. The system property sun.boot.class.path has been removed. Deployments that rely on overriding platform classes for testing purposes with -Xbootclasspath/p will need to changed to use the --patch-module option that is documented in JEP 261. The -Xbootclasspath/a option is unchanged.

like image 36
Jim Garrison Avatar answered Oct 03 '22 08:10

Jim Garrison