Installing and working with Maven 3 on Linux

Maven 3 can be installed via the following APT commands

  • sudo apt-get purge maven maven2 maven3       (removes all maven maven2 or any previous tried maven3 installs)
  • Install Maven 3.0.5 via the Ubuntu Software Centre
  • Screenshot 2015-04-11 10:48:48
  • use maven, type mvn -version at the terminal
  • rahulsaini@rahulsaini-UBUNTU:~$ mvn -version
    Warning: JAVA_HOME environment variable is not set.
    Apache Maven 3.0.5
    Maven home: /usr/share/maven
    Java version: 1.7.0_75, vendor: Oracle Corporation
    Java home: /usr/lib/jvm/java-7-openjdk-i386/jre
    Default locale: en_IN, platform encoding: UTF-8
    OS name: “linux”, version: “3.16.0-34-generic”, arch: “i386”, family: “unix”