LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 07-01-2003, 08:44 PM   #1
mbbender
LQ Newbie
 
Registered: Jul 2003
Location: NC
Posts: 17

Rep: Reputation: 0
upgrading java on red hat 9


I'm sort of new to linux and am having problem with java.

I just installed Red Hat 9. It came with java1.3.1 I think. I wanted to upgrade this so I downloaded 1.4.1_03. I just downloaded the jre, not the sdk. I followed some HOW-TO's to install it.

It was all installed into /usr/java/j2re1.4.1_03/
When I did java -version I still got the 1.3.1.

So i noticed there was a /java directory on the root and I turned the /java directory into the j2re1.4.1_03 directory. So now the /java directory has the same structure as the j2re1.4.1_03 directory. This did not help my version. However, when I called the whole path it was the right version, ie /java/bin/java -version it came up correctly with version 1.4.1. So I continued looking.

I also set my environment variables by creating /etc/profile.d/java.sh
This file contains
export JAVA_HOME=/java/bin
export CATALINA_HOME=/opt/tomcat
export PATH=$PATH:/java/bin
export PATH=$PATH:/java/lib/i386
export LD_LIBRARY_PATH=/java/lib/i386


I found that /usr/bin/java -version was 1.3.1. This was the only place I found 1.3.1 instead of 1.4.1. I thought it would be a good idea to
cp /java/bin/java /usr/bin/java and overide the current java in the /usr/bin so that when I went /usr/bin/java -version I would get 1.4.1

The result was not that at all. Instead I got errors "can't find libjava.so" "can't find java 2 runtime environment".

I've been trying to fix this problem for about a day now. I uninstalled the 1.4.1 package and put back on 1.3.1_08 and recopied the /usr/bin/java file with the 1.3.1_08 version. This got rid of the error "can't find java 2 runtime environment". I still have "can't find libjava.so" error. I've looked online and have found no comprehensive solutions.

I think the following solutions would be most helpful to me.
1) Help me fix this problem and end witth the 1.4.1 package or
2) Tell me how I can just get it back to how it was when I installed red hat 9 and I can start over trying to install 1.4.1 cleanly.
 
Old 07-01-2003, 10:27 PM   #2
cnjohnson
Member
 
Registered: Nov 2002
Location: Nashville
Distribution: FreeBSD, Linux, OS-X
Posts: 544

Rep: Reputation: 30
In your .bash_profile file in your home directory add a line at the end like:

export PATH=/usr/java/j2re1.4.1_03/:$PATH

This will cause linux to find Sun's 1.4.1 jre before the 1.3.1

HTH

Cheers--
Charles
 
Old 07-01-2003, 10:36 PM   #3
Electro
Guru
 
Registered: Jan 2002
Posts: 6,042

Rep: Reputation: Disabled
Try running one of the rpm removal programs and remove java 1.3.1. Then install java 1.4.1_0.

You can have both versions installed but rename java in /usr/bin to java-1.3. You may have to delete java if its an symbolic link. Then make a symbolic from java 1.4.1 directory to /usr/bin.
 
Old 07-02-2003, 12:35 AM   #4
mbbender
LQ Newbie
 
Registered: Jul 2003
Location: NC
Posts: 17

Original Poster
Rep: Reputation: 0
Thanks for the responses. Sadly they have not worked.

I edited my .bash_profile file. Created symbolic links like

ln -sdv /usr/java/j2re1.4.1_03/ /usr/bin/
ln -sdv /usr/java/j2re1.4.1_03/bin/ /usr/bin/
ln -sdv /usr/java/j2re1.4.1_03/lib/i386/ /usr/bin/

I still get "can not find libjava.so" as an error. This error started after I copied the java command from the java1.4.1_03 installation to overide the java command in the /usr/bin directory. So I'm pretty sure it has to do with the java command in the /usr/bin directory. Any thoughts or suggestions?
 
Old 07-02-2003, 07:13 AM   #5
cnjohnson
Member
 
Registered: Nov 2002
Location: Nashville
Distribution: FreeBSD, Linux, OS-X
Posts: 544

Rep: Reputation: 30
I do not think you need the symbolic links. Just have the new java directories searched in your path *before* the old java directories. That's all I did, and I have both.

Cheers--
Charles
 
Old 07-02-2003, 09:28 AM   #6
mbbender
LQ Newbie
 
Registered: Jul 2003
Location: NC
Posts: 17

Original Poster
Rep: Reputation: 0
Is there a way I can use my red hat 9 installations disks to just put the version of java that came installed with it back on and start over. This was my first task as a linux user so I didn't know what I was doing yet, but I think that with all your help and stuff I've read that I could upgrade to 1.4.1 a lot easier now. So if you know a way that I could reinstall the version of java on my installation disk and sort of undo everything I've done so far without reinstalling the whole distro, that would be helpful. Thanks for all your help so far by the way.
 
Old 07-07-2003, 01:47 PM   #7
mbbender
LQ Newbie
 
Registered: Jul 2003
Location: NC
Posts: 17

Original Poster
Rep: Reputation: 0
thank you cnjohnson. i reinstalled linux and used your advise and it worked wonderfully.
 
  


Reply


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
Upgrading QT on Red Hat 9 Adam Reyher Linux - Software 1 10-17-2004 02:19 PM
Upgrading Red hat thebutler4 Red Hat 3 05-28-2004 11:27 PM
Upgrading from Red Hat 7.3 kaplan71 Mandriva 1 02-25-2004 10:05 PM
Upgrading Red Hat 9 to Red Hat Enterprise Server 3 AS louisb Linux - Software 7 02-23-2004 10:25 PM
Red Hat Upgrading? dolvmin Linux - Software 3 09-17-2003 10:33 AM


All times are GMT -5. The time now is 07:41 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration