Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Distributions > Mandriva
User Name
Mandriva This Forum is for the discussion of Mandriva (Mandrake) Linux.


  Search this Thread
Old 07-31-2006, 09:03 AM   #1
Registered: Jan 2006
Location: Atlanta, GA
Distribution: Mandriva 2006
Posts: 75

Rep: Reputation: 15
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?
Old 07-31-2006, 10:17 PM   #2
Senior Member
Registered: Apr 2004
Location: Brisbane, Australia
Distribution: pclinuxos slackware64 tails kali
Posts: 3,372
Blog Entries: 33

Rep: Reputation: 217Reputation: 217Reputation: 217
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.
Old 08-01-2006, 08:36 AM   #3
Registered: Jan 2006
Location: Atlanta, GA
Distribution: Mandriva 2006
Posts: 75

Original Poster
Rep: Reputation: 15
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: with the following:
export JAVA_HOME=/usr/java/jdk-1.5.0_07
export PATH="$PATH:$JAVA_HOME/bin"

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

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?
Old 08-01-2006, 07:44 PM   #4
Registered: Jun 2006
Location: Oz
Distribution: Mandriva 10.0,10.1,10.2,2006,Mepis 6.0,Opensuse10.2,Puppy 2.14
Posts: 250

Rep: Reputation: 30
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
Old 08-02-2006, 08:38 AM   #5
Registered: Jan 2006
Location: Atlanta, GA
Distribution: Mandriva 2006
Posts: 75

Original Poster
Rep: Reputation: 15
I ended up just deinstalling the earlier version. Looks like I didn't really need it anyway.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
problem setting JAVA_HOME pkpro1 Linux - General 5 11-25-2007 09:49 AM
trouble installing jdk1.5.0_02 mayasedai Linux - Newbie 8 04-29-2005 06:52 PM
setting JAVA_HOME gauravbagga Linux - Newbie 2 03-04-2005 10:17 PM
Permanently Setting the Java_Home Dynapen Linux - Newbie 2 08-04-2004 02:53 PM
Opera Startup + Setting JAVA_HOME l2g Linux - Newbie 2 03-07-2004 06:43 AM > Forums > Linux Forums > Linux - Distributions > Mandriva

All times are GMT -5. The time now is 09:21 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration