Download (Oracle website)
Http://www.oracle.com/technetwork/java/javase/downloads/index.html
Install your own requirements to download the appropriate version
Choose a 64-bit jdk-7u79-linux-x64.tar.gz here
Installing the configuration JDK
1. Copy the jdk-7u79-linux-x64.tar.gz to the/usr/local directory (usually your own software is placed in this directory)
2.TAR-ZXVF jdk-7u79-linux-x64.tar.gz-c/usr/local/
3. Get the/usr/local/jdk1.7.0_79 directory
4. Modify the/etc/profile file: Vim/etc/profile
5. Add the profile last
Export java_home=/usr/local/jdk1.7.0_79
Export JRE_HOME=/USR/LIB/JDK/JDK1.7.0_10/JRE
Export path= $JAVA _home/bin: $JAVA _home/jre/bin: $PATH
Export classpath= $CLASSPATH:.: $JAVA _home/lib: $JAVA _home/jre/lib
6. Modify the default JDK in Linux
sudo update-alternatives--install/usr/bin/java Java/usr/local/jdk1.7.0_79/bin/java 300
sudo update-alternatives--install/usr/bin/javac Javac/usr/local/jdk1.7.0_79/bin/javac 300
sudo update-alternatives--config java
sudo update-alternatives--config javac
7. See if the modification was successful: java-version
Java Version "1.7.0_79"
Java (TM) SE Runtime Environment (build 1.7.0_79-b15)
Java HotSpot (TM) 64-bit Server VM (build 24.79-b02, Mixed mode)
If you find a problem or have questions, please let me know in time.
Linux installation configuration JDK