CentOS Ah ~centos ah ~centos AH ~ other not responsible Oh ~o (∩_∩) O haha ~
1. Install the JDK package jdk-7u80-linux-x64.rpm under Linux
Terminal input command: RPM-IVH jdk-7u80-linux-x64.rpm
2. Configure Environment variables
A. Using the Vim editor, open the/etc/profile file: Vim/etc/profile
b, add in line 54th of the profile file:
Java_home =/usr/java/jdk1.7.0_80
PATH = $PATH: $JAVA _home/bin
Export Java_home
C: Save exit: ESC--Input: Wq
D, execute the command: source/etc/profile, make the change take effect
E. Modify the link to the Java-related commands in the/usr/bin directory on the system:
Update-alternatives--install/usr/bin/java Java/usr/java/jdk1.7.0_80/bin/java 300
Update-alternatives--install/usr/bin/javac Javac/usr/java/jdk1.7.0_80/bin/javac 300
Update-alternatives--install/usr/bin/jar Jar/usr/java/jdk1.7.0_80/bin/jar 300
Update-alternatives--config Java
F, display all JDK versions, select the appropriate version to
3, verify, execute java-version command in terminal to see if the configuration is effective, display the corresponding information can
Installation and configuration of Java environment under Linux