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?