public static File getClassJar ( Class clazz ) { File file = null ; try { file = new File ( clazz . getProtectionDomain ( ) . getCodeSource ( ) . getLocation ( ) . toURI ( ) ) ; } catch ( URISyntaxException e ) { } return file ; }
Gets the jar file a class is contained in .