Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Installation of the Sun JDK is as easy as:
[see also explained at http://www.jpackage.org/installation.php\]

check the current java(c) version:

No Format
$ java -version

[probably the GNU one]

...

[probably the Eclipse Java Compiler]

Install the Sun JDK 

  1. get the latest Sun JDK RPM:
    Go to the directory where you want to download, extract and install (eg: cd /tmp, cd /root).
    No Format
    $ links http://java.sun.com/javase/downloads/index.jsp
    
    Choose the link to the latest JDK.
    On the download page: accept the agreement in links and download the JDK RPM-in-bin for linux.
  2. Make the downloaded binary executable and run it:
    No Format
    $ chmod u+x jdk-<version>-linux-i586-rpm.bin
    $ ./jdk-<version>-linux-i586-rpm.bin
    
    The rpm is extracted from the bin and installed (accept the license).
    The java version is now installed in /usr/java/. This dir contains all individual versions and two symlinks: "latest" and "default". You should never reference to any of these locations (see 4).
  3. Get the matching JPackage compatibility package for this Sun JDK:
    No Format
    $ links ftp://jpackage.hmdc.harvard.edu/JPackage/1.7/generic/RPMS.non-free/
    $ rpm -ivh java-x.x.x-sun-compat-x.x.x.xx-1jpp.i586.rpm
    
  4. To make the Sun JDK the default for the entire system, use the 'alternatives' method:. This will create symlinks in /etc/alternatives/ that are used throughout the entire system (eg see "$ ll /usr/bin/java").
    [select the Sun version instead of the GNU version for each of these commands]
    No Format
    $ /usr/sbin/alternatives --config java
    $ /usr/sbin/alternatives --config javac
    

check

...

the new installation

No Format

$ java -version

[should be the new Sun version]

No Format

$ javac -version

[should be the new Sun version]

Tomcat restart (optional)

Make Tomcat use this JDK now by restarting it:

No Format

$ /etc/init.d/tomcat5 restart