I don’t think that you can easily find out where the JAR file is, but you can find out in which directory your program is running:
File cwdFile = new File (".");
String cwd = cwdFile.getAbsolutePath();
This only works if the user actually runs the JAR file from the directory in which it is located:
java -jar MyExectuableJar.jar
If they start it from another directory, for example:
java -jar /usr/bin/java/MyExecutableJar.jar
, .