I have a program which includes the following line of code:
//String s = fileName;
File location = new File(s);
and then I have
//String contents = whatIWantToPrint;
OutputStream print = new FileOutputStream(location);
print.write(contents.getBytes());
print.close();
telling the program to print the string contents to the file s. However the file appears within the folder that the program is in rather than the directory in which the program is in. For example if the program is on the persons desktop I want it to make the file on their desktop.
I used the following line in terminal to make the program a jar file (mac):
jar -cvmf manifest.txt Generate.jar *.class