准备材料
jdk-8u281-linux-x64.tar.gz
apache-tomcat-8.5.83.tar.gz
操作步骤
- 文件上传
scp ./jdk-8u281-linux-x64.tar.gz root@192.168.56.101:~
scp ./apache-tomcat-8.5.83.tar.gz root@192.168.56.101:~
- 登录,并解压到
/usr/local/
ssh root@192.168.56.101
# 输入密码
tar -zxf jdk-8u281-linux-x64.tar.gz -C /usr/local/
tar -zxf apache-tomcat-8.5.83.tar.gz -C /usr/local/
- 配置环境变量,修改文件
~/.bashrc
,新增如下几行
export CLASSPATH=.:$JAVA_HOME/lib
export JAVA_HOME=/usr/local/jdk1.8.0_281/
export PATH=$PATH:$JAVA_HOME/bin