Subject: Install JAVA JDK on AWS EC2 instance
Author: Linux
Posted on: 10/12/2011 07:58:43 PM
Download a JDK RPM from http://download.java.net/jdk6/. Look for "RPM" under "Linux". Copy the link address to "jdk-6u29-ea-bin-b08-linux-i586-23_sep_2011-rpm.bin" and then use curl.
# mkdir /usr/local/java
# cd /usr/local/java
# curl http://download.java.net/jdk6/6u29/promoted/b08/binaries/
jdk-6u29-ea-bin-b08-linux-i586-23_sep_2011-rpm.bin > jdk-rpm.bin
Then follow the instructions on
http://alwajdi.blogspot.com/2007/12/how-to-install-snns-jdk-in-fedora-8.html to install the downloaded JDK.
# chmod 755 jdk-rpm.bin
# ./jdk-rpm.bin
# /usr/sbin/alternatives --install /usr/bin/java java /usr/java/jdk1.6.0_29/bin/java 100
# /usr/sbin/alternatives --install /usr/bin/jar jar /usr/java/jdk1.6.0_29/bin/jar 100
# /usr/sbin/alternatives --install /usr/bin/javac javac /usr/java/jdk1.6.0_29/bin/javac 100
# /usr/sbin/alternatives --config java
Type the following command to verify the exact path to which java executable under UNIX / Linux:
# which java
/usr/bin/java
Also to make sure the version is correct:
# java -version
java version "1.6.0_29-ea"
Java(TM) SE Runtime Environment (build 1.6.0_29-ea-b08)
Java HotSpot(TM) Client VM (build 20.4-b01, mixed mode, sharing)
Replies:
References: