1

Using JDK 8, I have simply been using the following:

URL[] urls = ((URLClassLoader) ClassLoader.getSystemClassLoader()).getURLs();

It appears this breaks in JDK 9+ as the ClassLoader is no longer a URLClassLoader.

How would I go about getting the current classpath if it has been modified by multiple classloaders?

Matt Clark
  • 27,671
  • 19
  • 68
  • 123

0 Answers0