Installation of Apache Maven On Amazon Linux 2023
Installation of Apache Maven On Amazon Linux 2023
The basic prerequisite for Maven is Java JDK because Maven is a build tool and it requires all
the build and compiles related java tools.
In the lab we’re going install JDK 17 by running the command below.
java –version
Step 1: Go to Maven Downlaods and get the download link of the latest package.
wget https://dlcdn.apache.org/maven/maven-3/3.9.4/binaries/apache-maven-3.9.4-bin.tar.gz
By Joseph Dong
Finishline Maven Installation lab September 27, 2023
Step 2: Untar the mvn package to the /opt folder.
sudo tar xvf apache-maven-3.9.4-bin.tar.gz -C /opt
Step 3: Create a symbolic link to the maven folder. This way, when you have a new version of
maven, you just have to update the symbolic link and the path variables remain the same.
We will do both by adding them to the profile.d folder. So that every time the shell starts, it
gets sourced and the mvn command will be available system-wide.
Step 2: Add the following to the script and save the file.
export M2_HOME=/opt/maven
export PATH=${M2_HOME}/bin:${PATH}
By Joseph Dong
Finishline Maven Installation lab September 27, 2023
By Joseph Dong