一、安装JDK
到官网网站下载jdk包
http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
这里下载一个包 可以从windows 上上传文件到linux中
yum -y install lrzsz
下载完后使用rz 选择上传
tar zxvf jdk-8u101-linux-x64.tar.gz #解压jdk
mv jdk1.8.0_101 /usr/local/jdk1.8 #移动位置叫JDK1.8
vim /etc/profile #编辑环境变量, 添加下面内容
JAVA_HOME=/usr/local/jdk1.8/
JAVA_BIN=/usr/local/jdk1.8/bin
JRE_HOME=/usr/local/jdk1.8/jre
PATH=$PATH:/usr/local/jdk1.8/bin:/usr/local/jdk1.8/jre/bin
CLASSPATH=/usr/local/jdk1.8/jre/lib:/usr/local/jdk1.8/lib:/usr/local/jdk1.8/jre/lib/charsets.jar
[[email protected] src]# source /etc/profile #查看java 版本是否是1.8
[[email protected] src]# java -version
java version "1.8.0_101"
Java(TM) SE Runtime Environment (build 1.8.0_101-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.101-b13, mixed mode)
二、安装tomcat
wget https://mirrors.tuna.tsinghua.edu.cn/apache/tomcat/tomcat-8/v8.5.24/bin/apache-tomcat-8.5.24.tar.gz #下载TOMCAT
tar zxf apache-tomcat-8.5.24.tar.gz #解压
mv apache-tomcat-8.5.24 /usr/local/tomcat #移动
/usr/local/tomcat/bin/startup.sh #开启服务
最后游览器访问地址加:8080