Binary releases of Maven can be downloaded from the Maven website.
The binary comes as a zip archive or as a tar.gz archive. After downloading it, the instructions from the install page can be followed:
JAVA_HOME environment variable is set and points to your JDK installation (not JRE). For example, on a Windows machine, this installation folder can correspond C:\Program Files\Java\jdk1.8.0_51.bin directory of the created directory (named apache-maven-3.3.9 for Maven 3.3.9) to the PATH environment variable. (Reference to change it on Windows).mvn -version on the command line.There is no need to set the M2_HOME or MAVEN_HOME environment variable.