Question

Is there a way to collect java class names(as Strings) on the jvm system path when you know nothing about the context of the classes? I have seen a few similar questions, but all require at least knowing the package names.

I have looked at Java Interface Instrumentation, but unless I'm misreading things, it appears to only relate to programs actively running on the JVM.

Was it helpful?

Solution

You can get the class path jars and directories via:

System.getProperty("java.class.path");

and then you can list all the classes in the jars as this answer shows.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top