0

I have used following code to print the classpath from inside of jar (build with intelliJ):

    URL[] urls = ((URLClassLoader) ClassLoader.getSystemClassLoader()).getURLs();
    for (URL url : urls) {
        System.out.println(url);
    }

However this throws NullPointerException. What am I doing wrong?

Andy Turner
  • 137,514
  • 11
  • 162
  • 243
heky__
  • 85
  • 2
  • 6

0 Answers0