Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

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 changed my CLASSPATH and JAVA_HOME variable to something like this

export CLASSPATH=$CLASSPATH:/usr/local/tomcat/lib
export JAVA_HOME

And when I try to compile, the path in the CLASSPATH variable still does not seem to be recognized. I either set the paths awkwardly or need to reboot.

Does what I did look right or is it somehow way off? Should I try rebooting or is there some more obvious mistake in what I am doing?

Thanks, Alex

Here are the compile errors:

package javax.servlet does not exist [javac] import javax.servlet.ServletException;

share|improve this question
How do you start tomcat? – Bittrance Apr 11 '11 at 18:45
It started when I booted. – Genadinik Apr 11 '11 at 19:02
up vote 2 down vote accepted

If tomcat started when the machine booted, making changes to your .bashrc will do no good, since tomcat probably is not run by your user. If tomcat was installed from a .deb package, you could have a look in /etc/default/tomcat6, you will probably find similar variables there. Otherwise, we need to know more about how the start script looks.

share|improve this answer

Did you "source" the file?

source /userdir/.bashrc (or whatever the specific filename is)

Either do that or re-login and the environment variables should be picked up.

share|improve this answer
@Quinn Just did the source command and it is still not picking up the lib directory :( – Genadinik Apr 11 '11 at 17:08
have you tried logging and logging out? what I do know right now is you shouldn't have to reboot :) – Quinn Murphy Apr 11 '11 at 17:14
@Quinn yeah I tried even rebooting - still no luck – Genadinik Apr 11 '11 at 17:50
would need more data then. Can you update the post with the messages indicating a different path during the compile? – Quinn Murphy Apr 11 '11 at 18:13
@Quinn Just added the error example – Genadinik Apr 11 '11 at 18:32

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.