title: Netbeans 9/10/11 cannot run program "cmd"
body: <p>I unzipped NetBeans 11 to <code>C:\netbeans</code>, installed several versions of the JDK to <code>C:\java</code> and created a test class within NetBeans containing a main method and one line of code <code>System.out.print("hello world");</code>. When I click the <em>Run Project</em> button, the output window shows the command:</p>
  
  <pre><code>cd C:\Users\MyUsername\Documents\NetBeansProjects\asdf; 
  JAVA_HOME=C:\\Java\\jdk1.8.0_231 cmd /c "\"\"C:\\netbeans-9\\java\\maven\\bin\\mvn.cmd\" 
    -Dexec.args=\"-classpath %classpath com.mycompany.asdf.Test\" 
    -Dexec.executable=C:\\Java\\jdk1.8.0_231\\bin\\java.exe  
    -Dmaven.ext.class.path=C:\\netbeans-9\\java\\maven-nblib\\netbeans-eventspy.jar  
    -Dfile.encoding=UTF-8 process-classes org.codehaus.mojo:exec-maven-plugin:1.5.0:exec\""
  </code></pre>
  
  <p>followed by the error:</p>
  
  <blockquote>
    <p>Cannot run program "cmd" (in directory "C:\Users\MyUsername\Documents\NetBeansProjects\asdf"): Malformed argument has embedded quote: "C:\netbeans-9\java\maven\bin\mvn.cmd" -Dexec.args="-classpath %classpath com.mycompany.asdf.Test" -Dexec.executable=C:\Java\jdk1.8.0_231\bin\java.exe -Dmaven.ext.class.path=C:\netbeans-9\java\maven-nblib\netbeans-eventspy.jar -Dfile.encoding=UTF-8 process-classes org.codehaus.mojo:exec-maven-plugin:1.5.0:exec</p>
  </blockquote>
  
  <p>Whether the class creates a GUI or not, it gives the same error. I've tried NetBeans 9, 10, and 11 with JDK 7, 8, and 11. Am I missing something during setup, or do I have something in a wrong directory somewhere? I'm lost.</p>