#!/bin/bash
cd /opt
mkdir java && mkdir maven && mkdir node
cd java
wget https://download.hezu.store/produce/opt/jdk-8u371-linux-x64.tar.gz
tar -zxvf jdk-8u371-linux-x64.tar.gz
cd /opt/maven
wget https://download.hezu.store/produce/opt/apache-maven-3.8.1-bin.tar.gz
tar -zxvf apache-maven-3.8.1-bin.tar.gz
cd /opt/node
wget https://download.hezu.store/produce/opt/node-v14.17.4-linux-x64.tar.xz
tar -xvf node-v14.17.4-linux-x64.tar.xz

sed -i '73a export JAVA_HOME=/opt/java/jdk1.8.0_371' /etc/profile
sed -i '74a export CLASSPATH=$:CLASSPATH:$JAVA_HOME/lib/' /etc/profile
sed -i '75a export PATH=$PATH:$JAVA_HOME/bin' /etc/profile
sed -i '76a export M2_HOME=/opt/maven/apache-maven-3.8.1' /etc/profile
sed -i '77a export M2=$M2_HOME/bin' /etc/profile
sed -i '78a export MAVEN_OPTS="-Xms256m -Xmx512m"' /etc/profile
sed -i '79a export PATH=$M2:$PATH' /etc/profile
sed -i '80a export NODE_HOME=/opt/node/node-v14.17.4-linux-x64' /etc/profile
sed -i '81a export PATH=$NODE_HOME/bin:$PATH' /etc/profile

source /etc/profile
