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?
To check our CLASSPATH on Windows we can open a command prompt and type echo %CLASSPATH%. To check it on a Mac you need to open a terminal and type echo $CLASSPATH.
By using the Class-Path header in the manifest, you can avoid having to specify a long -classpath flag when invoking Java to run your application. Note: The Class-Path header points to classes or JAR files on the local network, not JAR files within the JAR file or classes accessible over Internet protocols.
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 propertysun.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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With