java find path of current executing jar

Best solution : 
String path = Test.class.getProtectionDomain().getCodeSource().getLocation().getPath();
String decodedPath = URLDecoder.decode(path, "UTF-8");
You can use your own class name instead of 'Test'

No comments :

Post a Comment

Your Comment and Question will help to make this blog better...