How INSTALL JAVA and Set JAVA PATH in ubuntu



1.To install java , go to terminal and enter

sudo apt-get install openjdk-7-jdk

once you done the Installation


2.GO to Terminalto edit .bashrc file

vi ~/.bashrc

[if not allowing to edit you have to give the root permission by type “sudo”]

sudo vi ~/.bashrc


It will open the Text editor

3. Add this code to end of the Document
4.


JAVA_HOME=/usr/lib/jvm/jdk1.7.0
PATH=$PATH:$HOME/bin:$JAVA_HOME/bin
export
   JAVA_HOME
export
   JRE_HOME
   export PATH
Save the file 
4.To check whether the PATH is set properly 
Type JAVA -version
if you got like
this , PATH has beed set successfully 
java version "1.7.0_79"
OpenJDK Runtime Environment (IcedTea 2.5.5)
(7u79-2.5.5-0ubuntu0.14.04.2)
OpenJDK Server VM (build 24.79-b02, mixed mode)

No comments :

Post a Comment