Skip to content

mvn.bat cannot be found, build failed.  #152

@umbrellawind

Description

@umbrellawind

(Sorry to submit this when everyone's likely on holiday. Please don't feel obliged to deal with this until holidays are over.)

When I try to build the master project (Netbeans with TMC), I get an error saying mvn.bat cannot be found:
java.io.IOException: Cannot run program "mvn.bat" (in directory "C:\Users\joshu\Documents\computers\java mooc\tmc-netbeans-master\maven-wrapper"): CreateProcess error=2, The system cannot find the file specified

I followed the instructions in the README.markdown carefully.

I've tried my best to fix it, but no dice. I tried:

  • Restarting NetBeans (NB) and building again
  • Installing Apache Maven, and setting Java and Maven paths in System Environment Variables
    • Set JAVA_HOME to C:\Progra~1\Java\jdk1.8.0_231
    • Set MAVEN_HOME & M2_HOME to C:\Program Files\apache-maven-3.6.3
    • Set a new Path to %M2_HOME%\bin

I'm using:

  • Windows 10 Home (64 bit)
  • NB 11.1
    • NB 8.02 for the NetBeans Platform
  • JDK 8
  • Apache Maven 3.6.3

Here's the full output I get when I try to build:
platform.download:
ant -f "C:\\Users\\joshu\\Documents\\computers\\java mooc\\tmc-netbeans-master" build
Building the mavenmodules cluster.
NOTE: you may need to restart NetBeans for the editor to notice.
C:\Users\joshu\Documents\computers\java mooc\tmc-netbeans-master\build.xml:25: Execute failed:
java.io.IOException: Cannot run program "mvn.bat" (in directory "C:\Users\joshu\Documents\computers\java mooc\tmc-netbeans-master\maven-wrapper"): CreateProcess error=2, The system cannot find the file specified
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
at java.lang.Runtime.exec(Runtime.java:620)
at org.apache.tools.ant.taskdefs.launcher.Java13CommandLauncher.exec(Java13CommandLauncher.java:58)
at org.apache.tools.ant.taskdefs.Execute.launch(Execute.java:424)
at org.apache.tools.ant.taskdefs.Execute.execute(Execute.java:438)
at org.apache.tools.ant.taskdefs.ExecTask.runExecute(ExecTask.java:630)
at org.apache.tools.ant.taskdefs.ExecTask.runExec(ExecTask.java:669)
at org.apache.tools.ant.taskdefs.ExecTask.execute(ExecTask.java:497)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
at sun.reflect.GeneratedMethodAccessor103.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:99)
at org.apache.tools.ant.Task.perform(Task.java:350)
at org.apache.tools.ant.Target.execute(Target.java:449)
at org.apache.tools.ant.Target.performTasks(Target.java:470)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1388)
at org.apache.tools.ant.Project.executeTarget(Project.java:1361)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
at org.apache.tools.ant.module.bridge.impl.BridgeImpl.run(BridgeImpl.java:261)
at org.apache.tools.ant.module.run.TargetExecutor.run(TargetExecutor.java:574)
at org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:128)
Caused by: java.io.IOException: CreateProcess error=2, The system cannot find the file specified
at java.lang.ProcessImpl.create(Native Method)
at java.lang.ProcessImpl.<init>(ProcessImpl.java:444)
at java.lang.ProcessImpl.start(ProcessImpl.java:140)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
... 22 more
BUILD FAILED (total time: 0 seconds)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions