How do I, from Netbeans, for use with Tomcat, set up an environment variable that I can read using System.getProperty(...);
We have a sou
The answer is just in the NetBeans FAQ here:
http://wiki.netbeans.org/FaqSysPropsDuringRun
1. Go to the Tomcat Properties Platform Settings
In Netbeans, click the "Services" tag. Under "Servers", you'll see "Tomcat 7.0". Right click "Tomcat 7.0" and select "Properties". Then select the "Platform" tab.
2. Under VM Options, add -Dvariable=value
Leave the D in place, and replace the variable with whatever variable name you'd like to set and value whatever value you'd like to set the variable to.
3. Read out the property from your code.
System.out.println("The value is " + System.getProperty("variable"));