First, add Oracle's PPA, then update your package repository.
sudo add-apt-repository ppa:webupd8team/java sudo apt-get update
To install JDK 7, use the following commands:
sudo apt-get install oracle-java7-installer sudo apt-get install oracle-java7-set-default
Edit the system PATH file /etc/profile and add the following system variables to your system path. Use gedit, nano or any other text editor, as root, open up /etc/profile.
To open in gedit use below command:
sudo gedit /etc/profile
Scroll down to the end of the file using your arrow keys and add the following lines below to the end of your /etc/profile file:
If you are installing the JDK use below configuration (note: you are required to change the $JAVA_HOME as per the jdk location on your computer):
JAVA_HOME=/usr/local/java/jdk1.7.0_45 JRE_HOME=$JAVA_HOME/jre PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin export JAVA_HOME export JRE_HOME export PATH
Or if you are installing the JRE use below:
JRE_HOME=/usr/local/java/jre1.7.0_45 PATH=$PATH:$JRE_HOME/bin export JRE_HOME export PATH
Save the /etc/profile file and exit.
No comments:
Post a Comment