你把输入文件放在eclipse(java)中为了从控制台命令读取它在哪里? [英] Where do you put input file in eclipse(java) in order to read it from console command?
问题描述
我在eclipse(galileo版本)中编写一个java程序。该程序从控制台命令指定的输入文件中读取简单的用户数据并处理。
但我不知道应该将此输入文件放在eclipse工作区内,当我在eclipse中运行程序并输入输入文件名时,可以找到并且程序可以处理它。
并且有办法设置文件路径,
默认情况下,Java进程以项目目录作为工作目录启动。
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!
The Java process is started with the project directory as the working directory by default.
这篇关于你把输入文件放在eclipse(java)中为了从控制台命令读取它在哪里?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!