1, before installing the JDK to detect the system with the JDK, and uninstall it, operation as shown below
Instrumentation: Rpm-qa|grep GCJ presence of JDK
Uninstall: Uninstall all
Rpm-e–nodeps java-1.7.0-openjdk-1.7.0.91-2.6.2.3.el7.x86_64
Rpm-e–nodeps java-1.8.0-openjdk-headless-1.8.0.65-3.b17.el7.x86_64
Rpm-e–nodeps Tzdata-java-2015g-1.el7.noarch
Rpm-e–nodeps java-1.7.0-openjdk-headless-1.7.0.91-2.6.2.3.el7.x86_64
Rpm-e–nodeps java-1.8.0-openjdk-1.8.0.65-3.b17.el7.x86_64
Rpm-e–nodeps Python-javapackages-3.4.1-11.el7.noarch
Rpm-e–nodeps Papackages-tools-3.4.1-11.el7.noarch
2. Install JDK
Move the downloaded JDK to CentOS, where I put it under/usr/local/, and the download version is
jdk-7u80-linux-x64.gz, download address
Http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html
Extract JDK:
3, configuration
This is done by changing/etc/profile, which takes effect for all users, is not safe, and enters the command: Vim/etc/profile
Add at the bottom
Export java_home=/usr/local/jdk1.7.0_80
Export classpath=.: Javahome/lib/dt.jar:java_home/lib/dt.jar:java_home/lib/tools.jar
Export Path= Path:path:java_home/bin
As shown in figure:
Then save and exit
Re-enter the command: Source/etc/profile to make its configuration effective
Input: Java-version, Javac, Java detection is successful
Add: Jdk installation method in RPM format, personal recommendation
http://blog.csdn.net/czmchen/article/details/41047187
The above is purely personal notes, if there are deficiencies. Please spray ☞