3

I am trying to set environment variable CATALINA_HOME for tomcat server. I used the command

CATALINA_HOME=/usr/local/apache-tomcat-8.0.22
JAVA_HOME=/usr/lib/jvm/java-7-openjdk-i386

and

export PATH=$PATH:`$CATALINA_HOME`/bin:$JAVA_HOME

After executing all these commands when I type startup.sh on the terminal my tomcat server started. After reboot when I type startup.sh it is showing

startup.sh: command not found

Also when I tried to check value of environment variable by

echo $CATALINA_HOME or echo $JAVA_HOME it is showing a blank line. What should I do now? Thanks.

Debabratta Jena
  • 177
  • 3
  • 5
  • 14
  • 2
    Possible duplicate of [this](http://askubuntu.com/questions/3744/how-do-i-modify-my-path-so-that-the-changes-are-available-in-every-terminal-sess) – cstich Jun 02 '15 at 15:11
  • 2
    possible duplicate of [How to add a directory to my path?](http://askubuntu.com/questions/60218/how-to-add-a-directory-to-my-path) – Sylvain Pineau Jun 02 '15 at 15:23
  • In addition to the information in the links provided, note that you should remove the backticks (which denote *command substitution*) from around the `$CATALINA_HOME` variable – steeldriver Jun 02 '15 at 15:27

1 Answers1

1

To get an environment variable to keep its value after logging out and back in, put the commands in ~/.profile.

Ron Romero
  • 142
  • 1
  • 12