Installation process to Install OpenJKD 8 in Ubuntu 14.10

Tutorial to explain how to install OpenJKD 8 on Ubuntu 14.10

I found that Ubuntu 14.10 & Fedora 21 have OpenJDK 8 packages. By default Fedora 21 comes with OpenJKD 8.
So, here I’m going to explain how to install OpenJKD 8 on Ubuntu 14.10

1) Check current version of java
Use the below command to check installed version of java in your system.

root@amitmaheshwari.in [~]# java -version
java version "1.7.0_72"
Java(TM) SE Runtime Environment (build 1.7.0_72-b14)
Java HotSpot(TM) 64-Bit Server VM (build 24.72-b04, mixed mode)
The output clearly shows, i have installed Oracle JAVA 7 in my system.

2) Search OpenJDK 8 Packages
Use the below command to search OpenJDK 8 packages in your system.

root@amitmaheshwari.in [~]# apt-cache search openjdk-8-*
openjdk-8-dbg - Java runtime based on OpenJDK (debugging symbols)
openjdk-8-demo - Java runtime based on OpenJDK (demos and examples)
openjdk-8-doc - OpenJDK Development Kit (JDK) documentation
openjdk-8-jdk - OpenJDK Development Kit (JDK)
openjdk-8-jre - OpenJDK Java runtime, using Hotspot JIT
openjdk-8-jre-headless - OpenJDK Java runtime, using Hotspot JIT (headless)
openjdk-8-jre-jamvm - Alternative JVM for OpenJDK, using JamVM
openjdk-8-jre-zero - Alternative JVM for OpenJDK, using Zero/Shark
openjdk-8-source - OpenJDK Development Kit (JDK) source files

3) Install OpenJDK 8 packages
Use the below command to install OpenJDK 8 packages in your system.

4) Setup OpenJDK 8 as default
Use the below command to setup OpenJDK 8 as default java in your system.

root@amitmaheshwari.in [~]# sudo update-alternatives --config java
There are 3 choices for the alternative java (providing /usr/bin/java).

  Selection    Path                                            Priority   Status
------------------------------------------------------------
* 0            /usr/lib/jvm/java-7-oracle/jre/bin/java          1072      auto mode
  1            /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java   1071      manual mode
  2            /usr/lib/jvm/java-7-oracle/jre/bin/java          1072      manual mode
  3            /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java   1069      manual mode

Press enter to keep the current choice[*], or type selection number: 3
update-alternatives: using /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java to provide /usr/bin/java (java) in manual mode


5) Check current version of java
Use the below command to check installed version of java in your system.

root@amitmaheshwari.in [~]# java -version
openjdk version "1.8.0_40-internal"
OpenJDK Runtime Environment (build 1.8.0_40-internal-b09)
OpenJDK 64-Bit Server VM (build 25.40-b13, mixed mode)

 
Top
Maintained By Amit Maheshwari