I came across a problem of installing JDK on linux. This was interesting because I had to install JDK on a remote server machine. Here’s the process to do that.

  1. Downloaded file using wget (because I was told that there is only wget installed on the remote machine) from this location: http://www.java.net/download/jdk6/6u2/promoted/b02/binaries/jdk-6u2-ea-bin-b02-linux-i586-12_apr_2007-rpm.bin
  2. Now changed the permission of the downloaded file to 755 like this:
    chmod 755 jdk-6u2-ea-bin-b02-linux-i586-12_apr_2007-rpm.bin
  3. Then ran it by calling ./jdk-6u2-ea-bin-b02-linux-i586-12_apr_2007-rpm.bin Here I needed to type yes after going through the license document as my acceptance to the terms.
  4. I was made to find the path of the actual location of JDK installation and indicate the fedora to accept my choice by using updatedb;locate javac |grep bin.
  5. Now I required to run the alternative command to instruct Fedora to recognize Sun’s JVM.
    alternatives --install /usr/bin/java java /usr/java/jdk1.6.0_02/bin/java 100
    alternatives --install /usr/bin/jar jar /usr/java/jdk1.6.0_02/bin/jar 100
    alternatives --install /usr/bin/javac javac /usr/java/jdk1.6.0_02/bin/javac 100
  6. Finally I required to configure alternative to use Sun’s JVM as the default JVM by calling /usr/sbin/alternatives --config java

Now the installation process is over. This can be checked by saying java -version.

Here we need to remember that we have to login as root to the machine to do all the installation.


Leave a Reply

Your email address will not be published. Required fields are marked *