I know that latest official openJDK is java version "1.7.0_25". But there is java version "1.7.0_40" in development. Does anyone know how to install openJDK "1.7.0_40" on an Ubuntu machine?
1 Answer
If you want openJDK 1.7.0_40 for 32-bit Ubuntu then do as
wget http://www.java.net/download/jdk7u40/archive/b40/binaries/jdk-7u40-fcs-bin-b40-linux-i586-16_aug_2013.tar.gz
If you want openJDK 1.7.0_40 for a 64-bit Ubuntu then do as
wget http://www.java.net/download/jdk7u40/archive/b40/binaries/jdk-7u40-fcs-bin-b40-linux-x64-16_aug_2013.tar.gz
Then make a directory.
sudo mkdir -p /usr/lib/jvm
Then move the downloaded tar to above created directory with
sudo mv jdk-7u40-fcs-bin-b40-linux-i586-16_aug_2013.tar.gz /usr/lib/jvm
similarly you can move 64-bit also if you want.
Then cd that directory
cd /usr/lib/jvm
Then untar the archive with
32-Bit
sudo tar -xvf jdk-7u40-fcs-bin-b40-linux-i586-16_aug_2013.tar.gz
64-bit
sudo tar -xvf jdk-7u40-fcs-bin-b40-linux-x64-16_aug_2013.tar.gz
Then paste these line one by one , and these are for intimating Ubuntu that this is your default java and path of it.
sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/jvm/jdk1.7.0_40/bin/javac" 1
sudo update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jdk1.7.0_40/bin/java" 1
sudo update-alternatives --set "javac" "/usr/lib/jvm/jdk1.7.0_40/bin/javac"
sudo update-alternatives --set "java" "/usr/lib/jvm/jdk1.7.0_40/bin/java"
Then update your system profile , open it with
sudo gedit /etc/profile
then paste these lines
JAVA_HOME=/usr/lib/jvm/jdk1.7.0_40
PATH=$PATH:$JAVA_HOME/bin
export JAVA_HOME
export PATH
Now save & close.
Then reload your profile with
. /etc/profile
Then we are done. check your java version.
-
-
-
Hahaha, so you are striving for being the fastest answerer in the west? ;)– BraiamSep 4, 2013 at 2:03
-