Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
338 views
in Technique[技术] by (71.8m points)

java - How to set system property values in NetBeans?

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

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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
  • You can right click on the project, and select Properties.

  • Click on Run category and insert you configuration in VM Options

  • For instance, in your case, paste: -Djava.security.auth.login.config=sample_jaas.config

You've to use = not ==.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...