O'Reilly logo

Apache Maven Cookbook by Raghuram Bharathan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Installing Maven on Linux

Let us look at the steps to install Maven on Linux.

While there are many flavors of Linux (Ubuntu, Fedora, RHEL, SUSE, CentOS, and so on), the steps to set up Maven are similar.

Getting ready

Maven needs Java, specifically the Java Development Kit (JDK). Using the following steps, let us check if it is installed in your Linux system, which is a bit tricky:

  1. Open a terminal and run the following command:
    java -version
    
  2. See if you get an output similar to the following:
    java version "1.7.0_65"
    OpenJDK Runtime Environment (rhel-2.5.1.2.el6_5-x86_64 u65-b17)
    

    The preceding output will still not tell you where your Java is installed, which is required to set JAVA_HOME. You can get this information by performing the next set of steps. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required