如何在 NetBeans 中设置系统属性值? [英] How to set system property values in NetBeans?
问题描述
我正在学习有关 JAAS 身份验证的教程 此处 以及当它显示如何运行示例代码时,表示应使用 Java 启动程序的标准选项启动编译类,即 -Djava.security.auth.login.config==sample_jaas.配置.这样一个系统属性将被设置:
I 'm following a tutorial about JAAS Authentication here and when it shows how to run the example code, says that the compiled class should be launched with a standard option of Java launcher which is -Djava.security.auth.login.config==sample_jaas.config . In this way a system property will be set:
java -Djava.security.auth.login.config==sample_jaas.config sample.SampleAcn
我是用这种方式完成的,但现在我也想在 NetBeans 中运行代码.由于 NetBeans 使用 Ant,我认为指定这些选项可能会有所不同.我查看了 NetBeans 中的选项菜单,但没有找到任何内容.使用 NetBeans 运行时如何设置此属性?
I did it with this way, but now I want to run the code in NetBeans too. Since NetBeans use Ant I think specifying these options may be different. I looked at the options menus in NetBeans but didn't find anything. How could I set this property when running with NetBeans?
推荐答案
您可以右键单击该项目,然后选择
Properties
.点击
Run
类别并在VM Options
例如,在您的情况下,粘贴:
-Djava.security.auth.login.config=sample_jaas.config
For instance, in your case, paste:
-Djava.security.auth.login.config=sample_jaas.config
您必须使用
=
而不是==
.You've to use
=
not==
.这篇关于如何在 NetBeans 中设置系统属性值?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!