If you are really looking for a simple way to get the folder in which your JAR is located you should implement this format of the solution
It is easier than what are you are going to find (it is hard to find and many solutions are no longer supported, many others provide the path of the file instead of the actual directory) and this is proven working on version 1.12.
new File(".").getCanonicalPath()
Gathering the Input from other answers this is a simple one too:
String localPath=new File(getClass().getProtectionDomain().getCodeSource().getLocation().toURI()).getParentFile().getPath()+"\\";
Both will return a String with this format:
"C:\Users\User\Desktop\Folder\"
In a simple and concise line.