[CentOS-docs] Installing Java using jpackage.org's java-*-sun-compat RPMs

Thu Aug 16 21:46:25 UTC 2007
Andreas Rogge <a.rogge at solvention.de>

As requested on IRC, this is my proposed walkthough for installing Java
on CentOS 4 using jpackage.org's compat-rpm method.
Please review and comment.


1. make sure jpackage-utils is installed
$ rpm -q jpackage-utils
jpackage-utils-1.7.3-1jpp.2.el5

if it isn't already installed, you can install it using
# yum install jpackage-utils
The package is part of CentOS, so you don't need to any extra
repositories to install it.

2. configure the jpackage repositories in yum
Create a new file /etc/yum.repos.d/jpackage.repo and copy the following
text into it:

-- SNIP --
[jpackage-generic]
name=JPackage (free), generic
mirrorlist=http://www.jpackage.org/jpackage_generic.txt
failovermethod=priority
gpgcheck=1
gpgkey=http://www.jpackage.org/jpackage.asc
enabled=1
protect=0

[jpackage-rhel]
name=JPackage (free) for Red Hat Enterprise Linux $releasever
mirrorlist=http://www.jpackage.org/jpackage_rhel-$releasever.txt
failovermethod=priority
gpgcheck=1
gpgkey=http://www.jpackage.org/jpackage.asc
enabled=1
protect=0

[jpackage-generic-nonfree] 
name=JPackage (non-free), generic
mirrorlist=http://www.jpackage.org/jpackage_generic_nonfree.txt
failovermethod=priority
gpgcheck=1
gpgkey=http://www.jpackage.org/jpackage.asc
enabled=1
protect=0
-- SNIP --

3. Check the exact versions for which jpackage provides
java-sun-*-compat rpms
$ yum list "java-*-sun-compat"
Setting up repositories
Reading repository metadata in from local files
Excluding Packages in global exclude list
Finished
Available Packages
java-1.4.2-sun-compat.i586               1.4.2.10-1jpp  jpackage-generic
java-1.5.0-sun-compat.noarch             1.5.0.09-1jpp  jpackage-generic

In the above example it is 1.4.2 Update 10 and 1.5.0 Update 9

4. Download the jdk rpm for the version(s) you want from sun
Go to http://java.sun.com/products/archive/ and select the appropriate
version. Follow the instructions on the website to download the JDK in
RPM Format for Linux i586.

5. Unpack the downloaded file(s) and install the rpm(s)

$ sh j2sdk-1_4_2_10-linux-i586-rpm.bin
# rpm -Uhv j2sdk-1_4_2_10-linux-i586.rpm

and/or

$ sh jdk-1_5_0_09-linux-i586-rpm.bin
# rpm -Uhv jdk-1_5_0_09-linux-i586.rpm

6. Install the compat rpms using yum

# yum install java-1.4.2-sun-compat

and/or

# yum install java-1.5.0-sun-compat

7. Select what jdk to use with alternatives

# alternatives --config java

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3219 bytes
Desc: not available
URL: <http://lists.centos.org/pipermail/centos-docs/attachments/20070816/4262f0af/attachment-0003.bin>