1、安装JDK,并设置下环境变量
[root@centos5 tarbag]#./jdk-6u17-linux-i586.bin
Please enter "yes" or "no".
Do you agree to the above license terms? [yes or no]
yes 此处输入yes
For more information on what data Registration collects and
how it is managed and used, see:
http://java.sun.com/javase/registration/JDKRegistrationPrivacy.html
Press Enter to continue.....
Done.
[root@centos5 tarbag]# mv jdk1.6.0_17 /usr/local/java
[root@centos5 tarbag]# /usr/local/java/bin/java -version 查看下java的版本信息
java version "1.6.0_17"
Java(TM) SE Runtime Environment (build 1.6.0_17-b03)
Java HotSpot(TM) Client VM (build 11.3-b02, mixed mode, sharing)
[root@centos5 /]# vi /etc/profile 设置java环境变量如下
export JAVA_HOME=/usr/local/java
CLASSPATH=/usr/local/java/lib/dt.jar:/usr/local/java/lib/tools.Jar
PATH=/usr/local/java/bin:$PATH
export PATH JAVA_HOME CLASSPATH
[root@centos5 /]# source /etc/profile 使环境变量生效
[root@centos5 /]# java -version
java version "1.6.0_17"
Java(TM) SE Runtime Environment (build 1.6.0_17-b03)
Java HotSpot(TM) Client VM (build 11.3-b02, mixed mode, sharing)
从apache网站上下载tomcat包,并移动到/usr/local目录下
[root@centos5 root]# cd /usr/loca/src/tarbag/
[root@centos5 tarbag]# wget