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

1

5

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?

Stupefy answered 30/9, 2019 at 17:16 Comment(0)
C
7

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.

Commonable answered 30/9, 2019 at 17:34 Comment(2)
haha, love the "full measure" approach they've gone with. Not letting the JRE start if one was even thinking about using Extensions :DStupefy
Better to detect the issue at startup. The extension mechanism was deprecated in the JDK 8 time frame. The -XX:+CheckEndorsedAndExtDirs option was the option in JDK 8 to quickly detect a dependency on the mechanism.Hafer

© 2022 - 2024 — McMap. All rights reserved.