Question

I have installed JAVA 1.6 on Redhat Linux 4 and wanted to function it with tomcat 5.5 but i am facing the below issue: When I am stopping the tomcat server it is taking JAVA 1.6 , but when I am bringing it up , it is taking JAVA 1.5(this one is pre-installed and currently working). I am not understanding where i am missing. Please help me on this. I am really naive but hope to understand these things through you.

Points:

  1. Server has already installed JAVA 1.5 which is currently working. I want to change the JAVA to 1.6 from 1.5

  2. JAVA 6 has been installed in the directory --> /usr/java/jdk1.6.0_25/

  3. I have only changed tomcat start up file JAVA_HOME variable to export JAVA_HOME=/usr/java/jdk1.6.0_25/

  4. when i am stopping the server, it shows, Using JRE_HOME: /usr/java/jdk1.6.0_25/

  5. When I am starting the tomcat server, it shows, Using JRE_HOME: /apps/UTCinet-WK/jdk1.5.0_03

many thanks in advance

java -version

java version "1.6.0_25"
Java(TM) SE Runtime Environment (build 1.6.0_25-b06)
Java HotSpot(TM) Server VM (build 20.0-b11, mixed mode)

and when i stop the server, it shows:

Using CATALINA_BASE:   /apps/xxxx/tomcat/xxx/xxxx
Using CATALINA_HOME:   /apps/xxxx/jakarta-tomcat-5.5.9
Using CATALINA_TMPDIR: /apps/xxxx/tomcat/xxxx/xxxx/temp
Using JRE_HOME:       /usr/java/jdk1.6.0_25/
Confirming shutdown completion - 5 xxxxonds..

and when i start the server, it shows:

Setting environment (DEV) from hostname. at /apps/xxxx/scripts/get_env.pl line 18.
Using CATALINA_BASE:   /apps/xxxx/tomcat/xxxx/xxxx
Using CATALINA_HOME:   /apps/xxxx/jakarta-tomcat-5.5.9
Using CATALINA_TMPDIR: /apps/xxxx/tomcat/xxxx/xxxx/temp
Using JRE_HOME:       /apps/xxxx/jdk1.5.0_03
Was it helpful?

Solution

Check the following outputs:
1. echo $JAVA_HOME
2. echo $PATH
3. java -version
4. Check $CATALINA_HOME/bin/setenv.sh file

And if you're starting your tomcat via a service call (and not via startup.sh), check that script as well to see if the JAVA_HOME is set to something there.

Usually, fixing the setenv.sh file should do the trick.

OTHER TIPS

See if you have anything spurious going on in the $CATALINA_HOME/bin/setenv.sh file. That's the "preferred" place to set things like JAVA_HOME anyway.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top