As the title says, is there a way to get the current location of the .jar that is begun open, for example i have a file Test.jar and when i run it on desktop it works but when i run it from my documents it just will don't open.
An example of how can it be structured:
if(location == Desktop){
//Do stuff here
} else {
System.exit(0);
}
Thx for the help! and sorry for my bad English