Skip to content

Instantly share code, notes, and snippets.

@parzonka
Last active December 20, 2016 17:39
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save parzonka/62a7b52e853a0d8c70166e27f184a70f to your computer and use it in GitHub Desktop.
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