Reputation: 259
When I run this code on my MAC OS X in an eclipse web project
File file1 = new File("myfile.txt");
if( !file1.exists() ) file1.createNewFile();
System.out.println( file1.getAbsolutePath() );
it says
/Users/Richard/Desktop/eclipse/Eclipse.app/Contents/MacOS/myfile.txt
on my WINDOWS 7 computer it says
C:\Users\Richard\Documents\workspace\myproject\src\com\example\myclass\myfile.txt
How do I get my eclipse running on my MAC OS X to output files in my Documents folder like on my WINDOWS 7, instead of going into the Eclipse.app APP BUNDLE and being put into the folder Contents/MacOS ?
Upvotes: 1
Views: 2206
Reputation: 30136
If you're on Mac, then:
Open the 'Servers' tab.
Double click your server.
Click 'Open launch configuration'.
Click the 'Arguments' tab.
In the 'Working directory' pane, choose 'Other' and enter the path you want to have as your working directory.
Upvotes: 0
Reputation: 6567
You can change the working directory for any given launch configuration under Run
-> Run Configurations...
then under the Arguments
tab.
It's strange that your default seems to be within the Eclipse.app bundle—normally, it's ${workspace_loc:
project name
}
.
Unfortunately, it seems you still can't set the default working directory for all new run configurations.
Upvotes: 2