Environment variable MAVEN_HOME does not need to be specified (v3.5 ~)

Starting with maven version 3.5, you no longer have to specify the environment variable MAVEN_HOME during installation. This is because it has been modified so that the folder where maven is installed can be determined in the script at runtime.

Some sites in the world say that MAVEN_HOME, M2_HOME, MVN_HOME (?), Etc. are required, but in v3.5 or later, JAVA_HOME is the only environment variable that must be specified.

Install Apache Maven

Reference --comment of mvn.cmd

The following is a description of the arguments for version 3.6. Please refer to it when running on windows.

@REM -----------------------------------------------------------------------------
@REM Apache Maven Startup Script
@REM
@REM Environment Variable Prerequisites
@REM
@REM   JAVA_HOME          Must point at your Java Development Kit installation.
@REM   MAVEN_BATCH_ECHO  (Optional) Set to 'on' to enable the echoing of the batch commands.
@REM   MAVEN_BATCH_PAUSE (Optional) set to 'on' to wait for a key stroke before ending.
@REM   MAVEN_OPTS        (Optional) Java runtime options used when Maven is executed.
@REM   MAVEN_SKIP_RC     (Optional) Flag to disable loading of mavenrc files.
@REM -----------------------------------------------------------------------------

Reference --mvn comment

The following is a description of the arguments for version 3.6. Please refer to it when executing on Unix etc.

 -----------------------------------------------------------------------------
 Apache Maven Startup Script

 Environment Variable Prerequisites

   JAVA_HOME       Must point at your Java Development Kit installation.
   MAVEN_OPTS      (Optional) Java runtime options used when Maven is executed.
   MAVEN_SKIP_RC   (Optional) Flag to disable loading of mavenrc files.
 -----------------------------------------------------------------------------

Recommended Posts

Environment variable MAVEN_HOME does not need to be specified (v3.5 ~)
Does Java Need to Learn Anymore?
To not be a static uncle