Eclipse 命令行参数 [英] Eclipse command line arguments

查看:41
本文介绍了Eclipse 命令行参数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我了解如何使用运行配置菜单通过命令行参数运行我的应用程序.

I understand how to run my application with command line arguments using the run configuration menu.

我遇到的问题是,无论我将这些命令行参数更新为什么,当我执行代码时,eclipse 都不会反映这些更新.

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

这将打印:

args[0] = test1.txt
args[1] = test2.txt
args[2] = dfs

但是如果我更新参数并重新运行它,参数将不会更新

如何重置"参数并使用更新后的参数重新运行应用程序.

How can I "reset" the arguments and re-run the application using the updated arguments.

上面和下面都正常运行,实际上是 eclipse 导致了我的问题.问题通过简单重启 eclipse 得到解决.

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.

谢谢大家.

推荐答案

  1. 点击运行 -> 运行配置
  2. 点击参数标签
  3. 程序参数部分,输入您的参数.
  4. 点击应用
  1. Click on Run -> Run Configurations
  2. Click on Arguments tab
  3. In Program Arguments section , Enter your arguments.
  4. Click Apply

它肯定有效,因为我在写这个答案之前就在我的身上试过了

这篇关于Eclipse 命令行参数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆