Netbeans 9/10/11 cannot run program quot;cmdquot;(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 进程类 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,它都会给出相同的错误.我已经使用 JDK 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
找到您的
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";的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:Netbeans 9/10/11 无法运行程序“cmd";


- Jersey REST 客户端:发布多部分数据 2022-01-01
- Spring Boot连接到使用仲裁器运行的MongoDB副本集 2022-01-01
- Eclipse 插件更新错误日志在哪里? 2022-01-01
- Java包名称中单词分隔符的约定是什么? 2022-01-01
- C++ 和 Java 进程之间的共享内存 2022-01-01
- 从 finally 块返回时 Java 的奇怪行为 2022-01-01
- 如何使用WebFilter实现授权头检查 2022-01-01
- Safepoint+stats 日志,输出 JDK12 中没有 vmop 操作 2022-01-01
- 将log4j 1.2配置转换为log4j 2配置 2022-01-01
- value & 是什么意思?0xff 在 Java 中做什么? 2022-01-01