在jdk10中将外部罐子放在哪里

在jdk10中将外部罐子放在哪里

本文介绍了在jdk10中将外部罐子放在哪里的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直将外部jar放在JDK8的jre/lib/ext中但是,当我将jdk更新为jdk10时,我无法在jdk目录中找到jre子目录.因此,我从Oracle下载jre10,结果发现ext目录丢失了……我应该将那些外部jar放在哪里?

I've been putting external jars in jre/lib/ext in JDK8However ,when i update my jdk to jdk10,i cannot find jre sub-directory in jdk directory. So I download jre10 from Oracle and it turns out that the ext directory is missing... where should I put those external jars?

推荐答案

从JDK 8迁移到JDK 10 :

在以前的版本中,扩展名该机制使运行时环境可以查找和加载扩展类,而无需在类上专门命名它们小路.从JDK 9开始,如果您需要使用扩展类,确保JAR文件位于类路径上.

In previous releases, the extension mechanism made it possible for the runtime environment to find and load extension classes without specifically naming them on the class path. Starting in JDK 9, if you need to use the extension classes, ensure that the JAR files are on the class path.

如果java.ext.dirs退出,则javac编译器和java启动器将退出设置了系统属性,或者存在lib/ext目录.至另外检查平台特定的系统范围目录,指定-XX:+ CheckEndorsedAndExtDirs命令行选项.这导致如果目录存在且不为空,则会发生相同的退出行为.扩展类加载器保留在JDK 9(及更高版本)中并指定为平台类加载器(请参见getPlatformClassLoader.)

The javac compiler and java launcher will exit if the java.ext.dirs system property is set, or if the lib/ext directory exists. To additionally check the platform-specific systemwide directory, specify the -XX:+CheckEndorsedAndExtDirs command-line option. This causes the same exit behavior to occur if the directory exists and isn’t empty. The extension class loader is retained in JDK 9 (and later releases) and is specified as the platform class loader (see getPlatformClassLoader.)

这篇关于在jdk10中将外部罐子放在哪里的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-18 12:59