How to add a jar to the boot classpath in java 9

Qwerty :

In my application that runs on java 8, I am using -bootclasspath:p to add a jar to the boot classpath. In java 9, the option is removed. What is the alternative to do the same in java 9?

Anjana :

You may use -Xbootclasspath/a. Please refer to the release notes which states:-

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.

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=444174&siteId=1