First, download the JDK
Http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
Recommended Download tar.gz format
Second, installation
1. Extract to the specified directory
Find the installation package you downloaded, unzip to the specified directory
Command tar zxvf jdk-8u60-linux-i586.tar.gz-c/opt/(here-c/opt/for decompression path)
==> to see if the cd/opt/is successful after extracting LS
2. Configure Environment variables
When Ubuntu starts, it scans all the. sh files under the/ETC/PROFILE.D folder.
So create a new java.sh in this directory and configure the Jak related information as follows:
Java_home=/usr/java/jdk1.8.0_45
Path= $JAVA _home/bin: $PATH
Expert Java_home PATH
This configuration, the next time after the launch will take effect, if the first effective and do not want to restart, you can use
Command: Source/etc/profile
See if the echo $JAVA _home is successful if you return to the path.
Check to see if Java installs the success command java-version
Install Java JDK under Ubuntu