我正在运行 Eclipse Galileo。如何在 Eclipse 中启用断言?
根据其他网站的建议,我尝试添加参数:-ea
。我还尝试将编译器合规级别更改为1.4
。这些建议都不起作用。
- 前往menu
Run
,然后到菜单项 Run Configurations
.
In the 左面板, go to Java Application
,然后转到Assertions
.
In the 右面板, 选择tab Arguments
.
在下面field for VM arguments
, type -ea
启用断言。
- 单击
Apply
进而Run
button.
全局将其设置为一切都默认:
转到菜单Window
(如果您使用的是 Windows),或转到菜单Eclipse
(如果您使用的是 Mac)。对于 Linux 来说可能是类似的东西。
Go to Preferences
.
Choose Java
, 进而Installed JREs
来自左面板.
选择您的JRE,然后单击Edit...
按钮在右面板.
In the Default VM arguments
字段,添加-ea
.
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)