Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Java by (3.9k points)

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 very long and manual searching is not really an option. I recently had a problem where the classloader was loading an incorrect version of a class because it was on the classpath in two different places.

So how can I get the classloader to tell me where on disk the actual class file is coming from?

1 Answer

0 votes
by (46k points)
Another way to find out where a class is loaded from (without manipulating the source) is to start the Java VM with the option: -verbose:class

Related questions

0 votes
1 answer
+15 votes
2 answers
asked May 29, 2019 in Java by adam96 (800 points)
0 votes
1 answer

Browse Categories

...