Skip to content

Instantly share code, notes, and snippets.

@sebsto
Created August 8, 2014 15:53
Show Gist options
  • Save sebsto/19b99f1fa1f32cae5d00 to your computer and use it in GitHub Desktop.
Save sebsto/19b99f1fa1f32cae5d00 to your computer and use it in GitHub Desktop.
Install Maven with Yum on Amazon Linux
sudo wget http://repos.fedorapeople.org/repos/dchen/apache-maven/epel-apache-maven.repo -O /etc/yum.repos.d/epel-apache-maven.repo
sudo sed -i s/\$releasever/6/g /etc/yum.repos.d/epel-apache-maven.repo
sudo yum install -y apache-maven
mvn --version
@chiragkhatsuriya
Copy link

Works Perfect...
Thank You!

@marcello1221
Copy link

still is not working. i tried to check my PATH, echo $M2_HOME (it's invisible, not showing) does anybody have a suggestion?

@raman-trantor
Copy link

Thanks, @sebsto. This works on Amazon Linux 2.

@ram8283
Copy link

ram8283 commented Dec 6, 2019

perfect thank you so much

@subratamazumder
Copy link

thanks a lot 👍

@zhengnengchen
Copy link

This worked great but set maven (and my default java) to use Java 1.7. If you want to use Java 1.8, follow the above gist and then do:

yum search java | grep openjdk
yum install java-1.8.<revision number from yum search>-openjdk-headless.x86_64
yum install java-1.8.<revision number from yum search>-openjdk-devel.x86_64
update-alternatives --config java #pick java 1.8
update-alternatives --config javac #pick java 1.8

Thank you so much!

@giovani-anjos
Copy link

Thanks!!

@ecommerce-technician
Copy link

You saved me a ton of time, thanks!

@sultanahsan1982
Copy link

Thanks

@satishgudapati
Copy link

Thanks

@mintavi
Copy link

mintavi commented Jul 9, 2021

Thanks!!!!!!! Works great.

@ro-rah
Copy link

ro-rah commented Oct 28, 2021

This worked, thanks so much, you are legend!

@prince695
Copy link

how we can update maven version on amazon ec2

@gyaniyogi
Copy link

thanks a lot

@Ingcamilo890604
Copy link

thanks a lot

@mikaland
Copy link

mikaland commented Jul 6, 2024

;-)

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