Where do you put input file in eclipse(java) in order to read it from console command?

Todd picture Todd · Dec 18, 2009 · Viewed 63.6k times · Source

I am writing a java program in eclipse(galileo version). The program reads simple user data from input file specified at console command and process it.

But I am not sure where I should place this input file inside eclipse workspace, so that when I run program in eclipse and type in input file name, it can be found and program can process it.

and is there way to set file path so that I can just place input file anywhere and specified the file path at runtime?

thanks!

Answer

Robert Christie picture Robert Christie · Dec 18, 2009

The Java process is started with the project directory as the working directory by default.