will put the file in the "current directory" of the running application. What directory that is will vary from OS to OS and may depend on circumstances. It will often be the user home directory.
Java doesn't specifically support the idea of an "application", so unless you create the application in a way where you set up a variable specifically as you mentioned, I suspect the best you can do is to look at the system variable "
java.class.path" which could have several values, but it will have the location of the application JAR.