- 安装oracle java 7
a) sudo add-apt-repository ppa:webupd8team/java
b) sudo apt-get update
c) sudo apt-get install oracle-java7-installer
- 配置JAVA_HOME
a) Setup JAVA_HOME Variable
# export JAVA_HOME=/usr/lib/jvm/java-7-oracle
在console中输入即可,命令中的路径是java的路径。
b) Setup JRE_HOME Variable
# export JRE_HOME=/usr/lib/jvm/java-7-oracle/jre
c) Setup PATH Variable
#export PATH=$PATH: /usr/lib/jvm/java-7-oracle/bin: /usr/lib/jvm/java-7-oracle/jre/bin
- 安装tomcat
a) 下载
Wget http://apache.fayea.com/tomcat/tomcat-6/v6.0.43/bin/apache-tomcat-6.0.43.tar.gz
b) 解压
tar -xzvf apache-tomcat-6.0.43.tar.gz
c) mv apache-tomcat-6.0.43 /usr/local/tomcat
d) 启动和停止
Cd /usr/local/tomcat/bin
# ./startup.sh
# ./shutdown.sh
- 发布web项目
a) Eclipse中将web项目导出为war文件
b) 将文件复制到/usr/local/tomcat/webapps
c) 重新启动tomcat,部署完成
参考:
- http://stackoverflow.com/questions/16263556/installing-java-7-on-ubuntu
- http://tecadmin.net/steps-to-install-tomcat-server-on-centos-rhel/