Want to find which jar a java class is coming from? Then do this:
Class clazz = Class.forName("com.sleepycat.je.DatabaseException");
java.security.ProtectionDomain dom = clazz.getProtectionDomain();
java.security.CodeSource cs = dom.getCodeSource();
java.net.URL url = cs.getLocation();
out.println(url.toString());
Of course, replace "com.sleepycat.je.DatabaseException" with whatever class you're looking for.
Class clazz = Class.forName("com.sleepycat.je.DatabaseException");
java.security.ProtectionDomain dom = clazz.getProtectionDomain();
java.security.CodeSource cs = dom.getCodeSource();
java.net.URL url = cs.getLocation();
out.println(url.toString());
Of course, replace "com.sleepycat.je.DatabaseException" with whatever class you're looking for.
Version 5.1 last modified by Geoff Fortytwo on 11/07/2010 at 19:22
Document data
Attachments:
No attachments for this document