Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 468
Kamran Avatar asked Oct 20 '11 16:10

Kamran


People also ask

How do I change application properties in Netbeans?

Create the file.Right-click the org. myorg. systemproperties node, choose New > Java Class, and type PropertiesNotifier in Class Name. Click Finish.

Where is properties in Netbeans?

In the Projects window, right-click the System Properties project and choose Properties.

How do you do system properties in Java?

Writing System Properties To modify the existing set of system properties, use System. setProperties . This method takes a Properties object that has been initialized to contain the properties to be set. This method replaces the entire set of system properties with the new set represented by the Properties object.


1 Answers

  • 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 ==.

like image 180
stivlo Avatar answered Nov 03 '22 01:11

stivlo