I am having this very weird issue.
I have one servlet in which I want to access one system variable.
As per this documentation I have set my environment variable in /etc/environment
as
TEMP=Temp.something
Now when I do printenv TEMP
I get
Temp.something
Also I have wrote simple program like this
public class env {
public static void main(String[] args) {
String test = System.getProperty("TEMP");
System.out.println(test);
}
}
which outputs
Temp.something
Now, I have wrote one servlet which is deployed on tomcat on the same machine, which has this statement
System.out.println("Config : " + System.getenv("TEMP"));
This always prints null
.
I'm pretty new to servlets. Is something I'm missing?