To build a project, Maven uses its project object model (POM) and a set of plugins. The installation process of Apache Maven is quite simple, we just need to extract the Maven’s zip file and set up maven environment variables. However, Maven requires JDK to perform some important operations such as code compilation. So, before installing Maven on Windows 10, we need to make sure that Java JDK is installed and the JAVA_HOME environment variable is configured on our machine. Please refer to how to install on Windows 10 for more details. Java(TM) SE Runtime Environment (build 1.8.0_261-b12) We can type the following commands to check which JDK version is installed on our machine: Another important thing to keep in mind is that:Īpache Maven 3.3.1 requires JDK 1.7 or aboveĪpache Maven 3.2.1->3.2.5 requires JDK 1.6Īpache Maven 2.2 to 3.1.1 requires JDK 1.5Īpache Maven 2.0 to 2.1 requires Java 1.4 POEDIT NOT RECOGNIZED VARIABLE WINDOWS 10 Java HotSpot(TM) 64-Bit Server VM (build 25.261-b12, mixed mode)Īs we can see, the installed version of JDK is 1.8.0_261. Now, let’s download apache-maven-3.8.1-bin.zip and unzip it to a specific folder of our choice, for example: C:\Users\Asus\soft\apache-maven-3.8.1 Make sure to download the latest stable release which now 3.8.1 We can download Maven directly from the official website. Cool, right? Add MAVEN_HOME Environment Variable That’s all, NO installation is required to work with Mvn. ![]() The next step is to configure the MAVEN_HOME variable on Windows 10. MAVEN_HOME should point to the folder where we extracted Maven which is C:\Users\Asus\soft\apache-maven-3.8.1 in our case. To do so, open a new command prompt as administrator and type the following command:Ĭ:\Windows\system32>setx /M MAVEN_HOME "C:\Users\Asus\soft\apache-maven-3.8.1" Follow these steps to add the MAVEN_HOME environment variable:ġ- Type “edit” in the Window search box, then click on the “Edit the system environment variables”Ģ- Next, select the “Environment Variables…” buttonģ- Click on the “New…” button and put MAVEN_HOME as variable name and C:\Users\Asus\soft\apache-maven-3.8.1 as variable valueĪnother way to set up MAVEN_HOME is to use command lines. Now let’s add the last missing piece of the puzzle. This step is very important to run the Mvn command everywhere directly from the command prompt. ![]() Now that we put all the pieces together, let’s test if Apache Maven is successfully installed on Windows 10.Īpache Maven 3.8.1 (05c21c65bdfed0f71a2f2ada8b84da59348c4c5d) Please bear in mind that we can accomplish the same thing using this command line:Ĭ:\Windows\system32>setx /M PATH "%MAVEN_HOME%\bin %PATH%" To do so conveniently, we need to edit the PATH variable by appending the Maven bin folder %MAVEN_HOME%\bin. Java version: 1.8.0_261, vendor: Oracle Corporation, runtime: C:\Program Files\Java\jdk1.8.0_261\jreĭefault locale: en_US, platform encoding: Cp1252 Maven home: C:\Users\Asus\soft\apache-maven-3.8.1\bin\. 'mvn' is not recognized as an internal or external command, Common Issues 1) mvn is not recognized as an internal or external command OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"Īs shown above, the command indeed displays the Maven version, Maven bin folder, Java version, and operating system information. This means that the installation is not done properly, make sure %MAVEN_HOME%\bin is prepended to the PATH variable the right way. ![]() The JAVA_HOME environment variable is not defined correctly 2) JAVA_HOME environment variable is not defined correctly NB: JAVA_HOME should point to a JDK not a JRE This environment variable is needed to run this program launcher.Launcher This simply means that JDK is not installed and the JAVA_HOME variable is not properly configured. 3) Error: Could not find or load main class. In this case, you need to download the binary zip archive file, instead of the source zip archive. In this short article, we walked you through the steps of how to install Maven on Windows 10. Please feel free to reach out to me if you encounter any issues.In the 1940s, Stanley Smith Stevens introduced four scales of measurement: nominal, ordinal, interval, and ratio. These are still widely used today as a way to describe the characteristics of a variable.
0 Comments
Leave a Reply. |