linux下安装jdk和tomcat

时间:2021-12-03 19:07:05

1.下载JDK和tomcat

http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

http://tomcat.apache.org/download-70.cgi

2.安装JDK,在/usr下 mkdir java 

将jdk复制到.usr/java目录下,并且解压

3.配置好环境变量 vim /etc/profile

JAVA_HOME=/usr/java/jdk1.8.0_141
CLASSPATH=$JAVA_HOME/lib/
PATH=$PATH:$JAVA_HOMR/bin
export PATH CLASSPATH JAVA_HOME

4.重启服务器

5.安装tomcat,解压

6.在tomcat/bin下执行 chmod u+x *.sh 为所有者增加可执行权限

启动:cd tomcat/bin  --> ./startup.sh

关闭 :cd tomcat/bin --> ./shutdown.sh

7.http://127.0.0.1:8080验证是否启动成功