Netbeans 9/10/11 无法运行程序“cmd" [英] Netbeans 9/10/11 cannot run program "cmd"

查看:36
本文介绍了Netbeans 9/10/11 无法运行程序“cmd"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我将 NetBeans 11 解压到 C: etbeans,将多个版本的 JDK 安装到 C:java 并在 NetBeans 中创建了一个包含 main 方法和一行代码System.out.print("hello world");.当我单击 Run Project 按钮时,输出窗口显示命令:

I unzipped NetBeans 11 to C: etbeans, installed several versions of the JDK to C:java and created a test class within NetBeans containing a main method and one line of code System.out.print("hello world");. When I click the Run Project button, the output window shows the command:

cd C:UsersMyUsernameDocumentsNetBeansProjectsasdf; 
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""

后跟错误:

无法运行程序cmd"(在目录C:UsersMyUsernameDocumentsNetBeansProjectsasdf"中):格式错误的参数已嵌入引号:C: etbeans-9javamaveninmvn.cmd" -Dexec.args="-classpath %classpath com.mycompany.asdf.Test" -Dexec.executable=C:Javajdk1.8.0_231injava.exe -Dmaven.ext.class.path=C: etbeans-9javamaven-nblib etbeans-eventspy.jar -Dfile.encoding=UTF-8 process-classes org.codehaus.mojo:exec-maven-plugin:1.5.0:exec

Cannot run program "cmd" (in directory "C:UsersMyUsernameDocumentsNetBeansProjectsasdf"): Malformed argument has embedded quote: "C: etbeans-9javamaveninmvn.cmd" -Dexec.args="-classpath %classpath com.mycompany.asdf.Test" -Dexec.executable=C:Javajdk1.8.0_231injava.exe -Dmaven.ext.class.path=C: etbeans-9javamaven-nblib etbeans-eventspy.jar -Dfile.encoding=UTF-8 process-classes org.codehaus.mojo:exec-maven-plugin:1.5.0:exec

无论该类是否创建 GUI,它都会给出相同的错误.我已经在 J​​DK 7、8 和 11 上尝试了 NetBeans 9、10 和 11.我在安装过程中是否遗漏了什么,或者我在某个地方的目录中有什么错误?我迷路了.

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.

推荐答案

无需降级JDK,只需在netbeans.conf添加这个/strong>

No need to downgrade the JDK, just add this in your netbeans.conf

  1. 找到您的 netbeans.conf 文件.例如:netbeansIstallDir/etc/netbeans.conf

找到键 netbeans_default_options 并在字符串的开头添加以下内容:-J-Djdk.lang.Process.allowAmbiguousCommands=true

Find the key netbeans_default_options and at the start of the string add the following: -J-Djdk.lang.Process.allowAmbiguousCommands=true

它应该是这样的:

netbeans_default_options="-J-Djdk.lang.Process.allowAmbiguousCommands=true..."

这篇关于Netbeans 9/10/11 无法运行程序“cmd"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆