Created
April 9, 2013 16:51
-
-
Save wytten/5347343 to your computer and use it in GitHub Desktop.
How can I find out from where my class is loaded? Source: http://www.coderanch.com/how-to/java/Java-FAQ
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
import java.security.ProtectionDomain; | |
ProtectionDomain protectionDomain = getClass().getProtectionDomain(); | |
File codeLoc = new File(protectionDomain.getCodeSource().getLocation().getFile()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment