Does anyone know how to programmaticly find out where the java classloader actually loads the class from?
I often work on large projects where the classpath gets v
Simple way:
System.out.println(java.lang.String.class.getResource(String.class.getSimpleName()+".class"));
Out Example:
jar:file:/D:/Java/jdk1.8/jre/lib/rt.jar!/java/lang/String.class
Or
String obj = "simple test"; System.out.println(obj.getClass().getResource(obj.getClass().getSimpleName()+".class"));
Out Example:
jar:file:/D:/Java/jdk1.8/jre/lib/rt.jar!/java/lang/String.class