Search code examples
javaclassloaderjava-10

Where to place the custom jar added in ext and endorsed folder for jdk 10


In our application we have placed few custom jars in ext and endorsed folder. As jdk 9 onwards these folder are removed, during migration of our application to jdk 10 where to place these jar and how to handle this situation ?


Solution

  • Alan's comment:

    The -XX:+CheckEndorsedAndExtDirs options in JDK 8 is useful to detect usages of these mechanisms in preparation for migrating to JDK 9 or newer. The mechanisms were removed in JDK 9 as you have found. The replacement for the extension mechanism is to deploy the JAR file on the class path. The replacement for the endorsed standard override mechanism is the upgrade module path.

    I want to add that --patch-module may also be helpful.