Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm pretty new to Apache Tomcat and somewhat new to Linux altogether. I am trying to install the JDK, which is a prereq for Apache Tomcat. I downloaded and untarred the JDK to /usr/java and now I'm trying to set the environment path. I opened root's .bash_profile and added the following lines:

export JAVA_HOME

export PATH

But after I log out and back into the root profile and type


to test the changes all it returns is a blank line. Echoing $PATH doesn't return a path with the jdk directory included either.

I'm not sure what I did wrong, can anyone help?

share|improve this question
Beyond the obvious problem, this is not where you should be setting this variable in Tomcat. /path/to/tomcat/bin/ is the recommended place for container variables. For a more detailed overview of this topic, you can refer to a related answer of mine here. You can skip the "looking for customizations" step. – Andrew B Mar 6 '13 at 0:48
up vote 3 down vote accepted

You have to add that to your login script I believe, those changes are erased @ logout if I'm not mistaken. I've had the same issue on debian (Ubuntu) machines. Try manually adding the Java path to $Path like

export PATH



share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.