jetty and etc environment on ubuntu 12.10

冷暖自知 提交于 2019-12-13 02:34:36

问题


When running jetty project under IntelliJ I have no problem to read environment variable I set to /etc/environment using the System.getenv("var1") api.

When I deploy the war to Ubuntu server that start Jetty at boot, I get null when calling System.getenv("var1")

When I run a simple console application on the server under my user (suder user) I get the environment variable currently.

What I need to do in order to make the environment variables in /etc/environment visible to the war when it start automatically not under a user session?


回答1:


I think I needed to adjust this in the jetty.sh when I was getting things working on elastic beanstalk...

In the jetty.sh script you can source the /etc/environment file and they will be present. If that is what you are looking for then open a bug for it and we'll add it into the jetty.sh script for the next release.



来源:https://stackoverflow.com/questions/15884105/jetty-and-etc-environment-on-ubuntu-12-10

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!