Monday, April 25, 2016

Install java and set path for java in ubuntu

First install java: 

Using a PPA

You can use WebUpd8 PPA (this will download the required files from Oracle and install JDK 8):

sudo apt-add-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer
 
 
 
 
 

Set the path: 

 step 1: Type in the terminal

sudo gedit /etc/environment
 
 step 2: Then add these lines

JAVA_HOME=/usr/lib/jvm/java-8-oracle
PATH=$PATH:$HOME/bin:$JAVA_HOME/bin
export JAVA_HOME
export JRE_HOME
export PATH
 
Then save the file.

To check, have you installed or not:
Goto terminal and type following commands:

java -version 

You will see: 

 
 
Then you are done.

No comments:

Post a Comment