Installing Java on CentOS x86_64

WIth my new installation of CentOS x86_64, I was having problems trying to get java working with Firefox as well as a newer version of java.  Then I remembered from Fedora 8, that I was using the IcedTea Java.  So, I found that you can add a repo that gives you access to OpenJDK packages to get this working.

First add the repo:

and now, just install the two packages you need:

yum install java-1.6.0-openjdk java-1.6.0-openjdk-plugin.x86_64

This will fix Firefox immediately, but to change the system to use the later version of java, do this:

update-alternatives --config java

and then choose the option which is listed as:


on my system this was in position two, so I just pressed 2 and then I was done.  Verifying it has changed, is simple using:

java -version

and you're done.  Now I have 64 bit java both for Firefox and other java apps too.