0

I changed my CLASSPATH and JAVA_HOME variable to something like this

JAVA_HOME=/usr/local/jdk1.6.0_24
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;

Genadinik
  • 1,103
  • 4
  • 19
  • 39

2 Answers2

2

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.

Phil
  • 403
  • 6
  • 14
Bittrance
  • 3,070
  • 3
  • 24
  • 27
1

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.

Quinn Murphy
  • 463
  • 2
  • 8
  • @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
  • thanks...so are you trying to compile code or start tomcat? I was under the impression that it was the latter and now it seems like the former, which changes perspective. I agree with Bittrance that if we are starting tomcat we are looking to see how it starts and that .bashrc isn't what we want to change. – Quinn Murphy Apr 11 '11 at 19:20