Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
install jdk and maven for ubuntu
#!/bin/bash
# jdk
sudo su root
wget --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u73-b02/jdk-8u73-linux-x64.tar.gz
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 http://ftp-stud.hs-esslingen.de/pub/Mirrors/ftp.apache.org/dist/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.tar.gz
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.