Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试构建客户端服务器程序。所以我应该用不同的端口同时运行我的程序。程序通过参数获取端口。
这样做的方法是什么?谢谢
在创建启动配置(如@Konstantin 提到的那样)并将参数添加到Arguments>Program Arguments选项卡时,您可以使用一个变量,以便 eclipse 会在每次启动时询问您的参数。前任:-port ${string_prompt}
-port ${string_prompt}
如果您下拉运行工具栏按钮下的菜单,您将看到“运行配置...”。这将打开一个对话框,让您定义任意数量的启动配置。然后使用此下拉菜单使用不同的启动配置以不同的参数启动您的应用程序。