As a Java developer, to install some development tools under Linux is an essential skill to install jdk paper, for example, a detailed record of each step of the operation command, for reference.
0. Download jdk8
Login URL: http: //www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
select the corresponding jdk version download. (Available in the Windows download is complete, the shared folder by file onto Linux)
1. Log in Linux, switch to the root user
su root user to obtain root privileges, change the current working directory (root password required)
or
sudo -i do not need the root password to switch directly to the root (the current user password required)
2. The establishment of java installation directory under the usr directory
cd /usr
mkdir java
3. jdk-8u60-linux-x64.tar.gz copied to the java directory
cp /mnt/hgfs/linux/jdk-8u60-linux-x64.tar.gz /usr/java/
4. unpacked to the current directory jdk
tar -zxvf jdk-8u60-linux- x64.tar.gz
get folder jdk1.8.0_60
5. installed establish a link directory to save his length
(I did not use this step)
LN /usr/java/jdk1.8.0_60/ -s / usr / the JDK
6. edit the configuration file, configure the environment variables
vim / etc / profile
add the following: JAVA_HOME actual directory according to
the JAVA_HOME = / usr / Java / jdk1.8.0_60
the CLASSPATH = $ the JAVA_HOME / lib /
the PATH the PATH = $: $ the JAVA_HOME / bin
Export the PATH the JAVA_HOME the CLASSPATH
7. restart the machine or Run: source / etc / profile
sudo shutdown -r now
8. Review the installation
java -version
java version "1.8.0_60"
Java(TM) SE Runtime Environment (build 1.8.0_60-b27)
Java HotSpot(TM) Client VM (build 25.60-b23, mixed mode)