Created
June 14, 2011 21:53
-
-
Save jesperfj/1026008 to your computer and use it in GitHub Desktop.
Getting the Class-Path manifest attribute from the jar file that this class belongs to
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
java.util.jar.JarFile jar = | |
new java.util.jar.JarFile((thispackage.ThisClass.class.getProtectionDomain() | |
.getCodeSource().getLocation()).getFile()); | |
System.out.println(jar.getManifest().getMainAttributes().getValue("Class-Path")); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment