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
This is what we use:
public static String getClassResource(Class> klass) {
return klass.getClassLoader().getResource(
klass.getName().replace('.', '/') + ".class").toString();
}
This will work depending on the ClassLoader implementation:
getClass().getProtectionDomain().getCodeSource().getLocation()