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

后端 未结 3 1067
借酒劲吻你
借酒劲吻你 2021-01-05 01:27

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 no

相关标签:
3条回答
  • 2021-01-05 02:20

    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.

    0 讨论(0)
  • 2021-01-05 02:20

    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.

    0 讨论(0)
  • 2021-01-05 02:29

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

    0 讨论(0)
提交回复
热议问题