linux安装jdk
1.下载jdk
wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" "http://download.oracle.com/otn-pub/java/jdk/8u141-b15/336fa29ff2bb4ef291e347e091f7f4a7/jdk-8u141-linux-x64.tar.gz"
2.解压
tar -zxvf jdk-8u141-linux-x64.tar.gz
3.配置环境变量
vi /etc/profile ;然后在文件底部新增以下代码
export JAVA_HOME=/usr/java/jdk1.8.0_211
export JRE_HOME={JAVA_HOME}/lib:CLASSPATH
export JAVA_PATH={JRE_HOME}/bin
export PATH={JAVA_PATH}
4.刷新配置文件
source /etc/profile
5.查看是否配置成功
java -version
linux安装tomcat
1.下载tomcat
http://mirror.bit.edu.cn/apache/tomcat/tomcat-8/v8.5.49/bin/apache-tomcat-8.5.49.tar.gz
2.解压
tar -zxvf apache-tomcat-8.5.49.tar.gz