Search This Blog

Tuesday, July 19, 2011

how to get the jar file location for specific loaded class

this how to get the jar file location for specific class


   try {
File jarFile = new File(CLASS_NAME.class.getProtectionDomain().getCodeSource().getLocation().toURI());
} catch (URISyntaxException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}

Yaniv T

No comments: