JDK 安装文档
1)建立固定存放软件的目录
[[email protected] tools]# pwd
/home/oldboy/tools
02) 上传安装文件
rz -y
3)查看结果
[[email protected] tools]# ll
总用量 83776
drwxrwxrwx 6 1000 1000 4096 8月 25 07:37 inotify-tools-3.14
-rw-r--r-- 1 root root 358772 8月 25 19:34 inotify-tools-3.14.tar.gz
-rw-r--r-- 1 root root 85418489 1月 1 2015 jdk-6u27-linux-x64.bin
4)修改权限
[[email protected] tools]# chmod +x jdk-6u27-linux-x64.bin
[[email protected] tools]# ./jdk-6u27-linux-x64.bin #解压过程
#出现这个表示正常解压
Press Enter to continue.....
Done.
5) 安装jdk
[[email protected] tools]# mkdir -p /application/
[[email protected] tools]# mv jdk1.6.0_27/ /application/
[[email protected] application]# ll
总用量 16
lrwxrwxrwx 1 root root 25 6月 15 04:46 apache -> /application/apache2.2.17
drwxr-xr-x 2 root root 4096 6月 15 04:41 apache2.2.17
drwxr-xr-x 10 root root 4096 9月 3 20:47 jdk1.6.0_27
drwxr-xr-x 4 root root 4096 9月 3 20:24 svndata
drwxr-xr-x 2 root root 4096 8月 30 06:59 svnpasswd
[[email protected] application]# ln -s jdk1.6.0_27/ jdk
[[email protected] application]# ll
总用量 16
lrwxrwxrwx 1 root root 25 6月 15 04:46 apache -> /application/apache2.2.17
drwxr-xr-x 2 root root 4096 6月 15 04:41 apache2.2.17
lrwxrwxrwx 1 root root 12 9月 3 20:56 jdk -> jdk1.6.0_27/
drwxr-xr-x 10 root root 4096 9月 3 20:47 jdk1.6.0_27
drwxr-xr-x 4 root root 4096 9月 3 20:24 svndata
drwxr-xr-x 2 root root 4096 8月 30 06:59 svnpasswd
[[email protected] application]# ls -l /application/|grep jdk
lrwxrwxrwx 1 root root 12 9月 3 20:56 jdk -> jdk1.6.0_27/
drwxr-xr-x 10 root root 4096 9月 3 20:47 jdk1.6.0_27
6)检查JDK安装是否正确
[[email protected] application]# java -version
-bash: java: command not found
[[email protected] application]# /application/jdk/bin/java -version
java version "1.6.0_27"
Java(TM) SE Runtime Environment (build 1.6.0_27-b07)
Java HotSpot(TM) 64-Bit Server VM (build 20.2-b06, mixed mode)
7)设置环境变量
echo ‘#java env begin‘ >>/etc/profile
echo ‘export JAVA_HOME=/application/jdk‘ >>/etc/profile
echo ‘export CLASSPATH=$CLASSPATH:$JAVA_HOME/lib:$JAVA_HOME/jre/lib‘ >>/etc/profile
echo ‘export PATH=$JAVA_HOME/bin:$JAVA_HOME/jre/bin:$PATH:$HOME/bin‘ >>/etc/profile
echo ‘#java env end‘ >>/etc/profile
[[email protected] application]# tail -6 /etc/profile
alias vi=‘vim‘
#java env begin
export JAVA_HOME=/application/jdk
export CLASSPATH=$CLASSPATH:$JAVA_HOME/lib:$JAVA_HOME/jre/lib
export PATH=$JAVA_HOME/bin:$JAVA_HOME/jre/bin:$PATH:$HOME/bin
#java env end
8)检查环境变量
[[email protected] application]# echo $PATH
/application/jdk/bin:/application/jdk/jre/bin:/application/jdk/bin:/application/jdk/jre/bin:/application/jdk/bin:/application/jdk/jre/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin:/root/bin:/root/bin:/root/bin
[[email protected] application]# echo $JAVA_HOME
/application/jdk
[[email protected] application]# echo $CLASSPATH