如何在Java 9中将jar添加到引导类路径 [英] How to add a jar to the boot classpath in java 9
问题描述
在运行于Java 8的应用程序中,我正在使用-bootclasspath:p
将jar添加到引导类路径.在Java 9中,该选项已删除.在Java 9中执行相同操作的替代方法是什么?
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?
推荐答案
您可以使用-Xbootclasspath/a
.请参阅发行说明,其中指出: -
You may use -Xbootclasspath/a
. Please refer to the release notes which states:-
在此发行版中,引导类路径已被大部分删除. Java
-Xbootclasspath
和-Xbootclasspath/p
选项已被删除.
The boot class path has been mostly removed in this release. The java
-Xbootclasspath
and-Xbootclasspath/p
options have been removed.
javac -bootclaspath
选项仅在编译为JDK 8或
年纪大了.系统属性sun.boot.class.path
已被删除.
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.
依赖于覆盖平台类进行测试的部署
-Xbootclasspath/p
的用途将需要更改以使用
JEP 261 中记录的--patch-module
选项.
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.
-Xbootclasspath/a
选项保持不变.
这篇关于如何在Java 9中将jar添加到引导类路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!