How do you replace endorsed directory in Java 9?

 ̄綄美尐妖づ 提交于 2019-11-27 22:13:52

In JDK 9, you can use upgradeable modules or put the JAR files on the classpath.

The Java 9 migration guide states:

The java.endorsed.dirs system property and the lib/endorsed directory are no longer present. The javac compiler and java launcher will exit if either one is detected.

You would end up finding the error if any of these exists as :

<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.

These endorsed-standards override mechanism was removed to attain Modular Run-Time Images and would now use the modular image.

A modular image is composed of modules rather than JAR files. Going forward, endorsed standards and standalone APIs are supported in modular form only, via the concept of upgradeable modules.

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.
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!