Java: Where does the Extensions Class Loader get classes from in Java 13?

早过忘川 提交于 2020-05-23 09:54:24

问题


All the documentation I've been able to find mentions the 'jre/lib/ext' folder but such does not exist on my JRE 13 installation.

I guess somewhere between Java 8 (where I can see the jars in jre/lib/ext) and Java 13, they moved but I've been unable to pinpoint when and how it was done.

Could someone please elaborate what's going on with new JRE's, in terms of where the extension classes reside currently?


回答1:


The extension mechanism is gone with Java 9, not only moved [:-| , see the Important Changes and Information for Java 9:

The deprecated Extensions Mechanism has been removed. The runtime will refuse to start if ${java.home}/lib/ext exists or the system property java.ext.dirs is specified on the command line.

And also the Changes to the Installed JDK/JRE Image in JDK 9 Migration Guide:

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. In JDK 9, if you need to use the extension classes, ensure that the JAR files are on the class path.



来源:https://stackoverflow.com/questions/58172451/java-where-does-the-extensions-class-loader-get-classes-from-in-java-13

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