While trying to build a Java project under NetBeans (with an external Maven configured), I got the following error:
"C:\Users......\bin\mvn.bat"" is not recognized as an internal or external command, operable program or batch file"
Edit: Using Maven 3.3.3, Windows 10; Added custom maven to NetBeans under Tools > Options > Java > Maven > Execution > Maven Home > Browse
What can I do?
bat file at the 'C:\apache-maven-3.3. 9\bin' location.
If they don't exist then you need to right click My Computer--> Properties --> Advanced --> Environment variables. Add M2_HOME and JAVA_HOME environment variables there. To add M2_HOME do the same, set it to your location, for example: "C:\Program Files\Apache Software Foundation\apache-maven-3.3. 3".
To solve it:
bin
mvn.cmd
and mvnDebug.cmd
and rename those copies to have the extension .bat
source
Install Netbeans 8.1 or later to correct this issue.
As @mkleint noted, this is a problem with Maven 3.3.3+ where maven changed the mvn executable extension.You can download the latest version on the Netbeans website.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With