I use:
<context:property-placeholder location="file:${PROJECT_CONFIG_PATH}/project.conf" />
in my applicationContext.xml to get local config (one for development and another for production). PROJECT_CONFIG_PATH is a system environment variable (not eclipse env).
It works: on Windows in Eclipse (Jetty) and on Unix.
It doesn’t work: on Windows with Tomcat 6 (java.io.FileNotFoundException: ${PROJECT_CONFIG_PATH}\project.conf)
Could someone please tell me why Tomcat on Windows doesn’t see environment variables? And how could this be solved?
Thanks in advance!
If Tomcat is being run as a service, you will need to use the tomcat configuration editor to set the variable.
Start->Programs->Apache Tomcat x.x->Configure Tomcat
Select the Java tab
Add the variable under “Java Options” as:
Click OK and then restart the tomcat service.