Java jre1.5.0_07 on Centos 4.1

Hi I'm going crazy here.  I need to install jre1.5 for an app I want to use.  This is for an asterisk box.  I dont need it for firefox or other web browser.

I did a Yum install of the jpackage (I dont even know what that means)  it installed 1.4.X

I can from the command line do
java -version and get the version.

So that yum installer seems to work great.

I tried to use the self extracting .bin and the RPM from the Sun site.  Both ways seemed to go through the install fine but the only way I can get it to work is to call it through the full path... /usr/java/jre1.5X/bin/java -version

So my question is:  Step by step...
How do I uninstall 1.4
make it so when I do which java it uses 1.5.

Who is Participating?
pjedmondConnect With a Mentor Commented:
First remove java 1.4:

yum remove jpackage

Next ensure that java 1.5 is in your path:

Edit your .bashrc and add the line:



. ~/.bashrc

to update your PATH

This will add the directory with all the binaries to you PATH, so you should now be able to run:

java -version

should then give you 1.5 :)

(   (()
(`-' _\
 ''  ''
Heem14Connect With a Mentor Commented:

rpm -qa | grep -i java

you should be able to find the name of the 1.4 java rpm..

then do rpm -e name of java 1.4 package

then simply either add /usr/java/jre1.5x/bin to you path, or move the /usr/java/jre........ folder to someplace that is in your path. you may have to set some environment variables like JAVA_HOME JRE_HOME JAVA_ROOT

export 'JAVA_HOME'=/usr/java/jre1.5x/bin

or whatever you move it to if you move it.
livegirlloveAuthor Commented:
I used a little of both.
I didnt know how to get the yum package name to uninstall so I used the RPM uninstall.

added the path to bashrc and java - version finally works

livegirlloveAuthor Commented:

error: Failed dependencies:
        jre >= 1.5 is needed by asterfax-1.0-rc2.i386

well maybe I spoke to soon
livegirlloveAuthor Commented:
nevermind I got it.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.