Get active execution location


/ Published in: Java
Save to your folder(s)

The returned file will either contain the folder from where your program is running or the executable jar file, if your program is an executable jar.

I'm using `Main.class` because this code is in my main method (which is in the class 'Main'). You can replace `Main.class` by `getClass()` if you want to use this code in a non-static method.

URL: http://www.velocityreviews.com/forums/t147526-how-to-get-jar-file-name.html

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.