Get JAVA_HOME information from the sudo update-java-alternatives -l command.
export JAVA_HOME=/usr/lib/jvm/java-1.11.0-openjdk-amd64 Apache Maven depends on Java Development Kit so you must have either Oracle JDK or OpenJDK installed on your system. sudo nano /etc/profile.d/maven.shĪdd the following variables with the values. Sudo mv apache-maven-3.8.2 /opt/maven Setup Environment Variables for MavenĪfter you have placed Apache Maven binaries into the /opt directory, set the few environment variables for Maven by creating a maven.sh file under /etc/profile.d/ directory. curl -O Įxtract the Maven archive using the tar command and move the files to the /opt/ directory. writes technical articles based on Linux system administration for LinuxWays. You can visit Apache Maven’s official website to download the latest stable version of Maven or use the below command to download the Apache Maven v3.8.2 using the terminal. There are following two ways to install Apache Maven on the Ubuntu system. OpenJDK 64-Bit Server VM (build 11.0.12+7-post-Debian-2, mixed mode, sharing) Install Apache Maven on Debian OpenJDK Runtime Environment (build 11.0.12+7-post-Debian-2) Once you installed Java, verify the Java installation by running the below command. Here, I will be using OpenJDK v11 for Maven installation. You can either install Oracle Java or OpenJDK for your Maven installation. Install Java on DebianĪpache Maven requires JDK 7 or above.
#Linux maven install how to#
Here, we will see how to install Apache Maven on Debian 11. You can also use Maven to build and manage projects written in C#, Ruby, Scala, and other languages. Apache Maven is an open-source software project management and comprehension tool used by Java developers worldwide to manage all stages of the software development lifecycle, from building, reporting, assembling, and deployment.