问题 如何替换Java 9中的endorsed目录?


在Java 8和之前的版本中,存在使用支持目录(java.endorsed.dirs)的机制,该目录是覆盖JDK内部实现的库集合。

我怎样才能在Java 9中解决这个问题。在那里删除了被删除的dirs?


9633
2017-09-26 06:45


起源



答案:


在JDK 9中,您可以使用 可升级的模块 或者说 类路径上的JAR文件。

Java 9迁移指南 状态:

java.endorsed.dirs 系统属性和 lib/endorsed   目录不再存在。该 javac 编译器和 java   如果检测到任何一个,启动器将退出。

如果存在以下任何一种情况,您最终会发现错误:

<JAVA_HOME>/lib/endorsed is not supported. Endorsed standards and
standalone APIs in modular form will be supported via the concept of
upgradeable modules. Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

这些认可的标准覆盖机制被删除以实现 模块化运行时映像 现在将使用模块化图像。

模块化图像由模块而不是JAR文件组成。展望   支持转发,认可标准和独立API   只有模块化形式,通过概念 可升级的模块


9
2017-09-26 06:46





I also faced same issue, Java versions higher than 8 are not supported by Tomcat 9.
please check bin/catalina.sh for more information.
#JAVA_ENDORSED_DIRS (Optional) Lists of of colon separated directories
#containing some jars in order to allow replacement of APIs
#created outside of the JCP (i.e. DOM and SAX from W3C).
#It can also be used to update the XML parser implementation.
#This is only supported for Java <= 8.
#Defaults to $CATALINA_HOME/endorsed.

0
2018-04-19 13:44



“Tomcat 9不支持高于8的Java版本”这不是真的, 看看官方网站。它清楚地说“8 然后”。 - Impulse The Fox


答案:


在JDK 9中,您可以使用 可升级的模块 或者说 类路径上的JAR文件。

Java 9迁移指南 状态:

java.endorsed.dirs 系统属性和 lib/endorsed   目录不再存在。该 javac 编译器和 java   如果检测到任何一个,启动器将退出。

如果存在以下任何一种情况,您最终会发现错误:

<JAVA_HOME>/lib/endorsed is not supported. Endorsed standards and
standalone APIs in modular form will be supported via the concept of
upgradeable modules. Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

这些认可的标准覆盖机制被删除以实现 模块化运行时映像 现在将使用模块化图像。

模块化图像由模块而不是JAR文件组成。展望   支持转发,认可标准和独立API   只有模块化形式,通过概念 可升级的模块


9
2017-09-26 06:46





I also faced same issue, Java versions higher than 8 are not supported by Tomcat 9.
please check bin/catalina.sh for more information.
#JAVA_ENDORSED_DIRS (Optional) Lists of of colon separated directories
#containing some jars in order to allow replacement of APIs
#created outside of the JCP (i.e. DOM and SAX from W3C).
#It can also be used to update the XML parser implementation.
#This is only supported for Java <= 8.
#Defaults to $CATALINA_HOME/endorsed.

0
2018-04-19 13:44



“Tomcat 9不支持高于8的Java版本”这不是真的, 看看官方网站。它清楚地说“8 然后”。 - Impulse The Fox