如何在Java 9中将jar添加到引导类路径 [英] How to add a jar to the boot classpath in java 9

查看:280
本文介绍了如何在Java 9中将jar添加到引导类路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在运行于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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆