Campbell Ritchie wrote:You could use a file chooser to find your files, instead.
@Rajiv Rai:
Or you could use an absolute path. Or you could look at the "Run Configurations..." selection on the "Run" menu in Eclipse, where I think you can view and change the current directory.
Whenever you specify relative path to a file, rather than an absolute path, it has to be realtive
to something. When running a command in a terminal window, relative paths are taken to be relative to the current working directory--the directory you're "in" when you invoke the command. When launching
Java from an IDE, however, it's not obvious what the "current" directory will be. It's basically whatever the IDE chooses it to be, though by default it's probably something sensible like the project's root directory. If it is, though, that's only by convention.