How do I, from Netbeans, for use with Tomcat, set up an environment variable that I can read using System.getProperty(...);
We have a source controlled project – and we’re constantly making changes to confirurations that we “would” like to share (don’t want to use svn:ignore). We’re trying to set up one simple parameter, an environment variable to the config properties of our application. For example: mark.properties or john.properties. If the system can’t find the environment variable, then it defaults to server.properties (for the live system).
1. Go to the Tomcat Properties Platform Settings
2. Under VM Options, add -Dvariable=value
3. Read out the property from your code.