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 approach works for both files and jars:
Class clazz = Class.forName(nameOfClassYouWant); URL resourceUrl = clazz.getResource("/" + clazz.getCanonicalName().replace(".", "/") + ".class"); InputStream classStream = resourceUrl.openStream(); // load the bytecode, if you wish