1) su root
2) Mkdir/usr/java
3) chmod 777/usr/java
4) Cd/usr/java
5) tar-xvzf jdk-7u75-linux-x64.tar.gz
6) MV jdk1.7.0_75/usr/jdk1.7
7) cd/usr/jdk1.7
[Email protected] jdk1.7]# ls-l
Total 8
Drwxr-xr-x 8 UUCP 143 4096 Dec 17:04 jdk1.7.0_75
8) vi/etc/profile
JAVA_HOME=/USR/JDK1.7
classpath=.: $JAVA _home/lib/tools.jar: $JAVA _home/lib/dt.jar: $CLASSPATH
path= $JAVA _home/bin: $PATH
export Java_home CLASSPATH PATH
: w save file But do not exit VI
: W file saves the modification to file and does not exit VI
: w! force save, not eject VI
: Wq Save file and exit VI
: wq! force the file to be saved and exit VI
Q: Do not save file, exit VI
: q! do not save file, Force quit VI
: e! Discard all changes and edit from the last time the file was saved
9) source/etc/profile
echo $JAVA _home
Restart JDK installation takes effect
Installing the JDK in a Linux environment