Click to See Complete Forum and Search --> : JDK and Tomcat; missing some newbie information


Syngin
10-15-2001, 11:01 PM
Hey guys, here's one for you:

I've been looking after a server somewhat for the last six months so my 'running and modifying' experience is not bad. I seemed to have jumped ahead when it comes to installs though. Essentially, I'm trying to get Tomcat up on this box beside me. I've installed the java development kit which seemed to go ok. So did the Tomcat install (which i originally installed through rpm but I had no clue where the install went and all the install docs make a big point of referencing the directory it installed into so I switched to binaries)

*deep breath*

I go to run startup.sh and it says:
You must set JAVA_HOME to point at your Java Development Kit Installation.

Anyone have a clue where I set this? My understanding is that I need it set to access the webbased conf setup (ie. port 8080)

Is this a chicken and egg thing or is it just me?

Syngin
10-15-2001, 11:02 PM
Oh, this is Red Hat 7.0 just in case that info helps. :o

Syngin
10-16-2001, 12:31 AM
Oh, i think i have it narrowed to the catalina.sh. I'm still not sure where/how I enter this variable.

Any help would be greatly appreciated.

PLBlaze
10-16-2001, 10:56 AM
Well, you need to point $JAVA_HOME to directory where jdk was installed:

JAVA_HOME=/usr/local/java

export JAVA_HOME

then issue echo $JAVA_HOME to see if the path was set correctly...this is if you use bash as your shell.

For csh you would use setenv instead of export...

Now to have the path set on every boot/login you have 3 choices:

1. modify /etc/profiles to include JAVA_HOME

2. create .profile or .bash_profile, .bash_login, .bashrc file(s) in your users home directory (for csh use .cshrc) and add the JAVA_HOME variable

3. create a script containg the JAVA_HOME variable and call it from rc.local file, eg.

cd to /etc/rc.d then touch rc.java

edit the rc.java file with your favorite text editor and add something like this:

echo 'Exporting Java Path ... '
JAVA_HOME=/usr/local/java; export JAVA_HOME

save and chmod +x rc.java or chmod 0755 rc.java

edit rc.local and point it to the newly create rc.file

eg.

# Set java home
/etc/rc.d/rc.java

Hope this helps.

Syngin
10-16-2001, 11:10 AM
Cool. That's exactly what I needed. Thanks bud. :)