I have a runnable jar file that, when run, puts up a gui. The gui can be used to do various things including writing an output file. When I fire up the jar file at the command line by typing java -jar myprogram.jar, it works fine. However, if I start the jar file by double clicking it, the program works fine, but does not write an output file.. At least I don't find the output file where I expect it.
Note 1: The code extracts the current directory (i.e., the directory where the jar file resides). Output files are written to this directory. Note 2: I am working on a Linux machine running Ubuntu.
File currFolder = new File("");
defaultDirectory = currFolder.getAbsolutePath();
String outfile = defaultDirectory+"/testfile.mp3"