无法在Netbeans 8.2中运行64位JDK的Java FX项目。

huangapple go评论61阅读模式
英文:

Unable to Run 64 Bit JDK for java FX Project in Netbeans 8.2

问题

我正在尝试在我的Netbeans 8.2中运行一个JavaFX项目。当我编译/构建项目时,我收到以下错误信息。

在使用64位JDK时,我遇到了这个问题。但在使用32位JDK时,编译/构建/打包是正常的。

这是我的Jfx-impl.xml文件:

<target name="-check-jdk-version" depends="-do-init,-check-platform-home" unless="jdk-version-checked-in-jfximpl">
        <local name="version-output"/>
        <exec executable="${active.platform.home.java.executable}" outputproperty="version-output">
            <arg value="-version"/>
        </exec> 

尽管存在很多与错误代码193相关的解决方案,但我在互联网上找不到与JavaFX无关的解决方案。请问有人能告诉我可能导致此问题的原因以及如何使用64位JDK运行它吗?

英文:

I am trying to run a JavaFX Project in my Netbeans 8.2. When I compile/build the project I get this error.

I am running into this issue while while using JDK 64 bit. The compiling/building/packaging works when JDK of 32 Bit is used.

ant -f C:\\Nikesh\\Label\\LabelPrint jfxsa-run
C:\\Nikesh\\Label\\LabelPrint\nbproject\jfx-impl.xml:151: Execute failed: 
java.io.IOException: Cannot run program &quot;C:\Program Files\Java\jdk1.8.0_131\bin\java&quot; (in directory &quot;C:\\Nikesh\\Label\\LabelPrint&quot;): CreateProcess error=193, %1 is not a valid Win32 application
	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:426)
	at org.apache.tools.ant.taskdefs.Execute.execute(Execute.java:440)
	at org.apache.tools.ant.taskdefs.ExecTask.runExecute(ExecTask.java:629)
	at org.apache.tools.ant.taskdefs.ExecTask.runExec(ExecTask.java:670)
	at org.apache.tools.ant.taskdefs.ExecTask.execute(ExecTask.java:496)
	at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:293)
	at sun.reflect.GeneratedMethodAccessor76.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:106)
	at org.apache.tools.ant.Task.perform(Task.java:348)
	at org.apache.tools.ant.Target.execute(Target.java:435)
	at org.apache.tools.ant.Target.performTasks(Target.java:456)
	at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1405)
	at org.apache.tools.ant.Project.executeTarget(Project.java:1376)
	at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
	at org.apache.tools.ant.Project.executeTargets(Project.java:1260)
	at org.apache.tools.ant.module.bridge.impl.BridgeImpl.run(BridgeImpl.java:286)
	at org.apache.tools.ant.module.run.TargetExecutor.run(TargetExecutor.java:555)
	at org.netbeans.core.execution.RunClassThread.run(RunClassThread.java:153)
Caused by: java.io.IOException: CreateProcess error=193, %1 is not a valid Win32 application
	at java.lang.ProcessImpl.create(Native Method)
	at java.lang.ProcessImpl.&lt;init&gt;(ProcessImpl.java:386)
	at java.lang.ProcessImpl.start(ProcessImpl.java:137)
	at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
	... 22 more
BUILD FAILED (total time: 0 seconds)  

This is my Jfx-impl.xml file

&lt;target name=&quot;-check-jdk-version&quot; depends=&quot;-do-init,-check-platform-home&quot; unless=&quot;jdk-version-checked-in-jfximpl&quot;&gt;
        &lt;local name=&quot;version-output&quot;/&gt;
        &lt;exec executable=&quot;${active.platform.home.java.executable}&quot; outputproperty=&quot;version-output&quot;&gt;
            &lt;arg value=&quot;-version&quot;/&gt;
        &lt;/exec&gt; 

I could not find any solution in internet for the issue although there are many for the error code 193, not particularly related to java fx.
Can someone please tell me what could be causing the issue and how can I run this using a 64 bit JDK.

答案1

得分: 1

我不确定问题出在哪里,但我通过以下步骤解决了问题:

  1. 卸载了64位JDK
  2. 卸载了32位JDK
  3. 卸载了Netbeans
  4. 安装了64位JDK
  5. 安装了Netbeans 8.~
  6. 导入了JavaFX项目
英文:

I am not sure what was the issue, but I resolved the issue with following steps:

  1. Uninstalled JDK 64 Bit
  2. Uninstalled JDK 32 Bit
  3. Uninstalled Netbeans
  4. Installed JDK 64 Bit
  5. Installed Netbeans8.~
  6. Imported the JavaFX project

huangapple
  • 本文由 发表于 2020年7月24日 23:34:07
  • 转载请务必保留本文链接:https://go.coder-hub.com/63076793.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定