从现有机器 down 包
mkdir -p /mnt/software
// 找一台有 jdk 的机器 执行以下命令 (红色字体注意替换):
scp /mnt/software/jdk-8u211-linux-x64.tar.gz root@remoteip:/mnt/software/jdk-8u211-linux-x64.tar.gz
(输入: 机器 登录密码 )
mv apache-maven-3.6.2 maven-3.6.2
echo 'export JAVA_HOME=/mnt/jdk1.8.0_211' >> /root/.bashrc
echo 'export M2_HOME=/mnt/maven-3.6.2' >> /root/.bashrc
echo 'export JRE_HOME=/mnt/jdk1.8.0_211/jre' >> /root/.bashrc
echo 'export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JRE_HOME/lib' >> /root/.bashrc
echo 'export PATH=$PATH:$JAVA_HOME/bin:$M2_HOME/bin' >> /root/.bashrc
source /etc/profile
从网上下maven(安装到办公室的电脑):
Cd /mnt/software/maven
wget https://archive.apache.org/dist/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.tar.gz
(链接如果失效了就去这里找:Index of /dist/maven/maven-3/3.6.3/binaries)
解压重命名:
tar -zxvf apache-maven-3.6.3-bin.tar.gz
mv /mnt/software/maven/apache-maven-3.6.3 /mnt/apache-maven-3.6.3
cd /mnt/software/jdk
wget https://repo.huaweicloud.com/java/jdk/8u202-b08/jdk-8u202-linux-x64.tar.gz
mv /mnt/software/jdk/jdk1.8.0_202 /mnt/jdk1.8.0_211
echo 'export JAVA_HOME=/mnt/jdk1.8.0_211' >> /root/.bashrc
echo 'export M2_HOME=/mnt/apache-maven-3.6.3' >> /root/.bashrc
echo 'export JRE_HOME=/mnt/jdk1.8.0_211/jre' >> /root/.bashrc
echo 'export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JRE_HOME/lib' >> /root/.bashrc
echo 'export PATH=$PATH:$JAVA_HOME/bin:$M2_HOME/bin' >> /root/.bashrc
source /root/.bashrc
从办公室(remoteip : port)复制到办公室(本地):
scp -Pport root@remoteip:/mnt/software/jdk1.8.0_211.tar.gz /mnt/software/java/