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";
基础教程推荐
- FirebaseListAdapter 不推送聊天应用程序的单个项目 - Firebase-Ui 3.1 2022-01-01
- “未找到匹配项"使用 matcher 的 group 方法时 2022-01-01
- 无法使用修饰符“public final"访问 java.util.Ha 2022-01-01
- 设置 bean 时出现 Nullpointerexception 2022-01-01
- Java Keytool 导入证书后出错,"keytool error: java.io.FileNotFoundException &拒绝访问" 2022-01-01
- 在 Libgdx 中处理屏幕的正确方法 2022-01-01
- 如何使用 Java 创建 X509 证书? 2022-01-01
- Java:带有char数组的println给出乱码 2022-01-01
- 降序排序:Java Map 2022-01-01
- 减少 JVM 暂停时间 >1 秒使用 UseConcMarkSweepGC 2022-01-01