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.
- 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
- 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
- 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.
- 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.
- 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
- 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.