LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Mandriva
User Name
Password
Mandriva This Forum is for the discussion of Mandriva (Mandrake) Linux.

Notices


Reply
  Search this Thread
Old 07-31-2006, 08:03 AM   #1
RVDowning
Member
 
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, 09:17 PM   #2
GlennsPref
Senior Member
 
Registered: Apr 2004
Location: Brisbane, Australia
Distribution: Devuan
Posts: 3,657
Blog Entries: 33

Rep: Reputation: 283Reputation: 283Reputation: 283
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, 07:36 AM   #3
RVDowning
Member
 
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:

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?
 
Old 08-01-2006, 06:44 PM   #4
tytower
Member
 
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, 07:38 AM   #5
RVDowning
Member
 
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.
 
  


Reply



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 08:49 AM
trouble installing jdk1.5.0_02 mayasedai Linux - Newbie 8 04-29-2005 05:52 PM
setting JAVA_HOME gauravbagga Linux - Newbie 2 03-04-2005 09:17 PM
Permanently Setting the Java_Home Dynapen Linux - Newbie 2 08-04-2004 01:53 PM
Opera Startup + Setting JAVA_HOME l2g Linux - Newbie 2 03-07-2004 05:43 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Mandriva

All times are GMT -5. The time now is 06:18 AM.

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