gpt4 book ai didi

java - 如何在 Java 9 中将 jar 添加到引导类路径

转载 作者:塔克拉玛干 更新时间:2023-11-03 04:21:59 26 4
gpt4 key购买 nike

在我运行在 java 8 上的应用程序中,我使用 -bootclasspath:p 将 jar 添加到引导类路径。在 java 9 中,该选项被删除。在 Java 9 中做同样的事情的替代方法是什么?

最佳答案

您可以使用-Xbootclasspath/a。请引用release notes其中指出:-

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.

关于java - 如何在 Java 9 中将 jar 添加到引导类路径,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48148607/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com