Eclipse命令行参数 [英] Eclipse command line arguments
问题描述
我知道如何使用运行配置菜单使用命令行参数来运行我的应用程序。
我遇到的问题是,无论我更新这些命令行参数在执行代码时,eclipse不会反映这些更新。
到目前为止,我已经设置了参数:
test1.txt test2.txt dfs
将打印:
args [0] = test1.txt
args [1] = test2.txt
args [2] = dfs
但是如果我更新参数并重新运行,参数将不会更新
如何重置参数并使用更新的参数重新运行应用程序。
上面和下面两个都正常运行,事实上这是导致我问题的日食。通过简单的eclipse重启来解决问题。
感谢所有。
- 点击运行 - > 运行配置
- 点击参数标签
- 在程序参数部分,输入您的参数。
- 点击应用
工作原因我在我写了这个答案之前我试过了。
I understand how to run my application with command line arguments using the run configuration menu.
The problem I have is that no matter what I update these command line arguments to, eclipse does not reflect these updates when I execute the code.
so far I have set the arguments to:
test1.txt test2.txt dfs
and this will print:
args[0] = test1.txt
args[1] = test2.txt
args[2] = dfs
but if I update the arguments and re-run it, the arguments won't update
How can I "reset" the arguments and re-run the application using the updated arguments.
The above and below both function correctly and it was in fact eclipse that was causing me issues. The problem was resolved with a simple restart of eclipse.
Thanks all.
- Click on Run -> Run Configurations
- Click on Arguments tab
- In Program Arguments section , Enter your arguments.
- Click Apply
It is sure to work cause I tried it in mine right before I wrote this answer
这篇关于Eclipse命令行参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!