问题
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?
回答1:
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
-Xbootclasspathand-Xbootclasspath/poptions have been removed.The
javac -bootclaspathoption can only be used when compiling to JDK 8 or older. The system propertysun.boot.class.pathhas been removed.Deployments that rely on overriding platform classes for testing purposes with
-Xbootclasspath/pwill need to changed to use the--patch-moduleoption that is documented in JEP 261.The
-Xbootclasspath/aoption is unchanged.
来源:https://stackoverflow.com/questions/48148607/how-to-add-a-jar-to-the-boot-classpath-in-java-9