- JDK must be installed in the system.
- Download the binary tar .gz archive file from the Apache Maven website, i.e., from the location https://maven.apache.org/download.cgi. The file will look similar to “apache-maven-3.3.9-bin.tar.gz”.
- Create a new folder say “apache-maven” inside the location “/usr/local/” by running the command:
sudo mkdir -p /usr/local/apache-maven
- Move the downloaded “apache-maven-3.3.9-bin.tar.gz” file to the above created folder location by running the command:
sudo mv apache-maven-3.3.9-bin.tar.gz /usr/local/apache-maven
- Go to the folder location:
- Extract the contents of the archive file:
sudo tar -xzvf apache-maven-3.3.9-bin.tar.gz
- You have to set some variables like M2_HOME, M2, MAVEN_OPTS and PATH, which can be done by editing either “.profile” or “.bash_profile” file in the user’s HOME folder, or editing “/etc/profile” file. Editing the files inside the HOME folder will effect the user’s shell, while editing “/etc/profile” will make the changes available system-wide.To edit the file the command will be:
Ver la entrada original 145 palabras más