Setting User Environment Variables for tomcat on Windows

后端 未结 1 495
一整个雨季
一整个雨季 2021-01-13 04:42

I am running tomcat 8 on windows 2012.

I have a webapp that needs an user environment variable to be set in order to run.

I can start tomcat and retrieve the

相关标签:
1条回答
  • 2021-01-13 05:02

    Had the same problem and I've just managed to solve it.

    From an admin command prompt do the following command:

    tomcat8 //US//YourServiceName ++Environment varname=value
    

    You can set more than one variable by separating them with a semicolon (;) or a hash (#). The documentation is quite clear, but it's just difficult to believe anything's happened, because there's no visual indication anywhere, meaning if you run:

    tomcat8w //ES//YourServiceName 
    

    to get the GUI config tool you will not see the environment variable anywhere, but if you run the service it will pick it up. It's like hidden magic. Don't know why they haven't included it somewhere in the config panel.

    0 讨论(0)
提交回复
热议问题