LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Mandriva (https://www.linuxquestions.org/questions/mandriva-30/)
-   -   Problem setting JAVA_HOME when installing jdk1.5 (https://www.linuxquestions.org/questions/mandriva-30/problem-setting-java_home-when-installing-jdk1-5-a-469360/)

RVDowning 07-31-2006 08:03 AM

Problem setting JAVA_HOME when installing jdk1.5
 
On Mandriva 2006, trying to install jdk1.5 (used by Tomcat 5.5) with jdk 1.4 already installed. I try to add JAVA_HOME="/usr/java/jdk1.5.0_07" <br> export JAVA_HOME after the export statement in /etc/profile. However, logging out and back in, when I do echo $JAVA_HOME I still get /usr/lib/jdk-1.4.2_09. Any ideas on how to get it to point to the newer one?

I was leaving jdk 1.4 there since some older java programs would need it. Does this have to be removed?

GlennsPref 07-31-2006 09:17 PM

I would install jdk where it normally goes and link any programs that need it.

To remove/uninstall the old java is probably a good thing seeing how the new versions have security fixes

and still do all the normal stuff you'd expect.

I think you need to tell Tomcat where java is located, not change your whole system for one application.

good luck.

RVDowning 08-01-2006 07:36 AM

What I ended up doing was:

I went into /etc/profile.d directory and marked each java related file (sh and csh) as non-executable. (These were all 1.4.2 based) I then added files:

jdk-1.5.0_07.sh with the following:
export JAVA_HOME=/usr/java/jdk-1.5.0_07
export JDK_HOME=$JAVA_HOME
export PATH="$PATH:$JAVA_HOME/bin"
export MANPATH="$MANPATH:$JAVA_HOME/man"

and jre-1.5.0_07.sh with the following:
if [ -z "$JAVA_HOME" ]; then
export JAVA_HOME=/usr/java/jre-1.5.0_07
export PATH="$PATH:$JAVA_HOME/bin"
fi

and made them executable.

I removed the entries I had put in .etc/profile and logged out and back in.

Now the PATH and JAVA_HOME environment variables look right. Perhaps I should have just deinstalled the jdk(jre)1.4.2 stuff -- I don't know. I haven't yet found anything that doesn't work right. Any good reason to keep the 1.4.2 release, or should I urpme it -- or will that cause me some yet unknown problems?

tytower 08-01-2006 06:44 PM

Surely if you go in as root and edit the bash or whatever shell you use profile ,somewhere the JAVA_HOME variable will be set to 1.4 version initially.

Find that entry and change it to the 1.5 version and bobs your uncle?

The path and others should be automatically changed without interference

Your task is to find the original entry

RVDowning 08-02-2006 07:38 AM

I ended up just deinstalling the earlier version. Looks like I didn't really need it anyway.


All times are GMT -5. The time now is 10:29 PM.