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

六眼飞鱼酱① 提交于 2019-11-30 20:03:45

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

The default working directory, when you run a Java app in Eclipse, is the project directory. If you place your data file in that directory, you can simply refer to the file without any preceding path. You can also change the working directory but modifying the launch properties for your app.

Alternatively you can just specify the file path as an argument to your Java process. Under the Run menu, choose Run Configurations... You should see your class under Java Applications. Select the Arguments tab and just specify the path in the Program Arguments field.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!