在 Eclipse 上测试时如何传递 -D 系统属性? [英] How to pass the -D System properties while testing on Eclipse?

查看:29
本文介绍了在 Eclipse 上测试时如何传递 -D 系统属性?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在 Windows 上的 Eclipse 上进行开发,而代码部署在 Unix 上.我正在使用 System.getProperty("key") 获取系统属性值......我如何在 Eclipse 中传递它,这样我就不必修改代码并且它可以在 Eclipse 上进行调试?

I am developing on Eclipse on Windows and Code gets deployed on Unix. I am fetching the system property values using System.getProperty("key") ... How do I pass this in Eclipse so that I do not have to modify the code and it works on Eclipse for debugging?

有什么建议吗?

推荐答案

Run -> Run配置,选择项目,第二个标签:Arguments".顶部框用于您的程序,底部框用于 VM 参数,例如-Dkey=value.

Run -> Run configurations, select project, second tab: "Arguments". Top box is for your program, bottom box is for VM arguments, e.g. -Dkey=value.

这篇关于在 Eclipse 上测试时如何传递 -D 系统属性?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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