Created
August 28, 2014 07:59
-
-
Save stianl/426788abc17a4245665d to your computer and use it in GitHub Desktop.
Get where class was loaded from
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
// http://stackoverflow.com/questions/1983839/determine-which-jar-file-a-class-is-from | |
Class klass = String.class; | |
URL location = klass.getResource('/'+klass.getName().replace('.', '/')+".class"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment