Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
install jdk and maven for ubuntu
# jdk
sudo su root
wget --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie"
tar -zxf jdk-8u73-linux-x64.tar.gz -C /opt
update-alternatives --install /usr/bin/java java /opt/jdk1.8.0_73/bin/java 100
echo 'export JAVA_HOME=/opt/jdk1.8.0_73' >> /home/ubuntu/.bash_profile
rm jdk-8u73-linux-x64.tar.gz
# mvn
wget -N
tar -zxf apache-maven-3.3.9-bin.tar.gz -C /opt
printf "export M2_HOME=/opt/apache-maven-3.3.9\nexport PATH=\$PATH:\$M2_HOME/bin" >> /home/ubuntu/.bash_profile
rm apache-maven-3.3.9-bin.tar.gz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.