Skip to main content

Finding the JAR which loaded the class

No replies
dekz
Offline
Joined: 2010-07-04
Points: 0

I'm in need of finding the JAR which a class belongs to. For example I have an external JAR which is referenced in the classpathExtension as 00002.jar. When I attempt to TheClass.class.getProtectionDomain().getCodeSource().getLocation() it returns the main Xlet jar and not the JAR which it was loaded from. So it returns for example /:E:/test/dist/DiscImage/BDMV/JAR/00000 instead of 00002.

Is there any way to get the correct jar using such system methods?

Message was edited by: dekz