1. jdk
a.下载linux版本的jdk: jdk-7u71-linux-x64.tar.gz
b.拷贝到linux:/usr/local,解压文件 tar -xvf jdk-7u71-linux-x64.tar.gz
c.配置环境变量
vim /etc/profile
JAVA_HOME=/usr/local/jdk1.7.0_71
JAVA_BIN=/usr/local/jdk1.7.0_71/bin
PATH=$PATH:$JAVA_BIN
CLASSPATH=$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
export JAVA_HOME JAVA_BIN PATH CLASSPATH
d.查看java安装
[root@iZ28t57xzbcZ ROOT]# java -version java version "1.7.0_71" Java(TM) SE Runtime Environment (build 1.7.0_71-b14) Java HotSpot(TM) 64-Bit Server VM (build 24.71-b01, mixed mode)
2.tomcat
a.下载linux版本的tomcat:apache-tomcat-7.0.62.tar.gz
b.拷贝到linux: /usr/local,解压tar -xvf apache-tomcat-7.0.62.tar.gz
c.配置环境变量
vim /etc/profile
export CATALINA_HOME=/usr/local/apache-tomcat-7.0.62
export CLASSPATH=.:$JAVA_HOME/lib:$CATALINA_HOME/lib
export PATH=$PATH:$CATALINA_HOME/bin
d.启动tomcat
[root@iZ28t57xzbcZ bin]# sh startup.sh Using CATALINA_BASE: /usr/local/apache-tomcat-7.0.62/ Using CATALINA_HOME: /usr/local/apache-tomcat-7.0.62/ Using CATALINA_TMPDIR: /usr/local/apache-tomcat-7.0.62//temp Using JRE_HOME: /usr/local/jdk1.7.0_71 Using CLASSPATH: /usr/local/apache-tomcat-7.0.62//bin/bootstrap.jar:/usr/local/apache-tomcat-7.0.62//bin/tomcat-juli.jar Tomcat started.
关闭tomcat
[root@iZ28t57xzbcZ ROOT]# sh /usr/local/apache-tomcat-7.0.62/bin/shutdown.sh Using CATALINA_BASE: /usr/local/apache-tomcat-7.0.62/ Using CATALINA_HOME: /usr/local/apache-tomcat-7.0.62/ Using CATALINA_TMPDIR: /usr/local/apache-tomcat-7.0.62//temp Using JRE_HOME: /usr/local/jdk1.7.0_71 Using CLASSPATH: /usr/local/apache-tomcat-7.0.62//bin/bootstrap.jar:/usr/local/apache-tomcat-7.0.62//bin/tomcat-juli.jar