Skip to content

Instantly share code, notes, and snippets.

@gaquino
Last active November 10, 2020 18:22
Show Gist options
  • Save gaquino/e41b946fd624355f37e9079a1c0792f5 to your computer and use it in GitHub Desktop.
Save gaquino/e41b946fd624355f37e9079a1c0792f5 to your computer and use it in GitHub Desktop.
Setup Amazon EC2 - Java 8 + Maven
---- install Oracle JDK 1.8
$ wget --no-check-certificate --no-cookies --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u141-b15/336fa29ff2bb4ef291e347e091f7f4a7/jdk-8u141-linux-x64.rpm
$sudo yum install -y jdk-8u141-linux-x64.rpm
---- install OpenJDK
$ vi install.sh
yum install -y java-1.8.0-openjdk-devel
yum remove java-1.7.0-openjdk
wget http://repos.fedorapeople.org/repos/dchen/apache-maven/epel-apache-maven.repo -O /etc/yum.repos.d/epel-apache-maven.repo
sed -i s/\$releasever/6/g /etc/yum.repos.d/epel-apache-maven.repo
yum install -y apache-maven
mvn --version
yum install -y git
$ chmod 755 install.sh
$ sudo ./install.sh
---- python
sudo pip install gunicorn
sudo pip install -r requirements.txt
@kilsbo
Copy link

kilsbo commented Mar 15, 2018

For the openjdk and maven installation, this unfortunatly ends up with Java 7.

@woei66
Copy link

woei66 commented Mar 21, 2018

sudo update-alternatives --config java
sudo update-alternatives --config javac
you can use above commands to change java version to java-1.8

@Minwoo-Kang
Copy link

Minwoo-Kang commented May 7, 2018

this works perfectly.

Thank you for your knowledge :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment