Tim Holloway wrote:Every process has its own environment. The environment is not a global space. Although spawning a new process offers the option to clone the parent process environment, changes to the child process' environment won't be reflected in its parent or in any other process environment (such as your command shell session).
In fact, this can cause difficulties when you want to execute a script that will invoke a child script that sets up environment variables, which is why Linux/Unix has the "export" command specifically to push selected child environment variables up to the caller.
So everything is operating as it should be for you.
Tim Holloway wrote:Why do you want such values to be global? That would interfere with being able to run more than one Tomcat. Having JAVA_HOME be the same in all processes would be even worse, since you could very well have different Java apps running under different versions of Java.
It is sufficient that Tomcat's own process have its CATALINA_HOME properly set. Which was automatically done for you when you started the Tomcat service.