install JRE/JDK on ubuntu 16.06

For Mac system Download ‘dmg’ file from here and double click on it.

http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

For Linux: 

Don’t install OpenJDK

 $ sudo apt update && sudo apt install openjdk-9-jre-headless
 $ java -version
 openjdk version "9-internal"
 OpenJDK Runtime Environment (build 9-internal+0-2016-04-14-195246.buildd.src)
 OpenJDK 64-Bit Server VM (build 9-internal+0-2016-04-14-195246.buildd.src, mixed mode) 

Install Oracle Java:

 $ sudo add-apt-repository ppa:webupd8team/java
 $ sudo apt-get update
 $ sudo apt-get install oracle-java8-installer
 $ java -version
 java version "1.8.0_171"
 Java(TM) SE Runtime Environment (build 1.8.0_171-b11)
 Java HotSpot(TM) 64-Bit Server VM (build 25.171-b11, mixed mode) 

After installing Java on Linux system, You must have to set JAVA_HOME and JRE_HOME environment variables. Which is used by many Java applications to find Java libraries during runtime. You can set these variables in /etc/environment file using the following command.

 cat >> /etc/environment <<EOL
 JAVA_HOME=/usr/lib/jvm/java-8-oracle
 JRE_HOME=/usr/lib/jvm/java-8-oracle/jre
 EOL 

Author: Abhilash

Hey! This is Abhilash - A Ruby developer for years, specialised on web development. Right now working as a freelance Ruby Developer. I am also working on Angular, Sinatra and many other backend infra. Mainly working on Ruby On Rails platform since 2010. This blog is about Ruby, Ruby On Rails and other subjects that I had a chance to go through. You can contact me here: abhilash.amballur@gmail.com Abhilash AK

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s