Identifying the source of a Class file
Sometimes you may need to identify the jar file from where a specific Class has been loaded. This information is useful when you need to deal with some weird ClassLoader issues. The following API may help you here.
YourClz.class.getProtectionDomain().getCodeSource().getLocation();
YourClz.class.getProtectionDomain().getCodeSource().getLocation();
Very nice! I was missing this.
ReplyDeleteAlso there are some tools to get that jar of a class when you have ClassNotFoundException