Install JDK 7 on CentOS and JDK 7 on centos
1. Download jdk
Http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html
Select jdk-7u75-linux-x64.rpm
2. Install jdk
Create directoryMkdir/usr/java
Switch to the download directory and copy the downloaded file/Usr/java cp jdk-7u75-linux-x64.rpm/usr/java
Switch to/usr/java to modify permissionsChmod + x jdk-7u75-linux-x64.rpm
RunRpm-ivh jdk-7u75-linux-x64.rpm
3. environment variable configuration
Vi/etc/profile
Add at the end:
# Set java environment
Export JAVA_HOME =/usr/java/jdk1.7.0 _ 75
Export CLASSPATH =.: $ JAVA_HOME/lib/dt. jar: $ JAVA_HOME/lib/tools. jar
Export PATH = $ PATH: $ JAVA_HOME/binexport JAVA_HOME CLASSPATH PATH
Save and exit: X
Enable environment variable Configuration: Source/etc/profile
Establish a connection:
Cd/usr/bin
Ln-s-f/usr/java/jdk1.7.0 _ 75/jre/bin/java
Ln-s-f/usr/java/jdk1.7.0 _ 75/bin/javac
4. Detection
Java-version javac