Forum Moderators: bakedjake

Message Too Old, No Replies

JAVA_HOME environmental variable

Where does it go?

         

john316

5:25 pm on Oct 26, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I put the following in my /etc/profile file thinking java might run, to no avail. I'm sure the setup is simple I just can't "see" it. Can anyone tell me how to set this up (java environmental variable) on a redhat 7.3 box?

JAVA_HOME=/usr/java/j2re1.4.2_2
CATALINA_HOME=/home/work/.gnome-desktop/tomcat/jakarta-tomcat-5
PATH=$JAVA_HOME/bin:$PATH:$HOME/bin:/sbin:/usr/sbin
CLASSPATH=$CATALINA_HOME/bin/bootstrap.jar:$JAVA_HOME/lib/tools.jar:$CATALINA_HOME
<line break to accomadate no scroll>
/common/lib/servlet.jar:/usr/local/pgsql/share/java/postgresql.jar:../lib/struts.jar:.

I'm trying to get Tomcat running.

Thanks.

Duckula

5:42 pm on Oct 26, 2003 (gmt 0)

10+ Year Member



Try exporting all the defined variables, for example

FOO=/usr/bin/foo
export FOO

john316

6:11 pm on Oct 26, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



So it would be:

JAVA_HOME=/usr/java/j2re1.4.2_2
export JAVA_HOME

did that and did

$ javac
bash: javac: command not found
$ java -version
bash: java: command not found

Still not finding java?

MonkeeSage

8:56 pm on Oct 26, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Export everything...

export JAVA_HOME=/usr/java/j2re1.4.2_2
export CATALINA_HOME=/home/work/.gnome-desktop/tomcat/jakarta-tomcat-5
export PATH=$JAVA_HOME/bin:$PATH:$HOME/bin:/sbin:/usr/sbin
...

I think the variables have to be exported into the command shell or else they will just be local to the scope of the shell script and won't be setting, or be accessible as, environment variables.

Jordan

mozopera

1:20 am on Oct 27, 2003 (gmt 0)

10+ Year Member



If command is not found it means that javac is not in your path. You will have to extend your PATH variable to include the path where the java compiler lives.