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

Viewed 133

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 "C:\Program Files\Java\jdk1.8.0_131\bin\java" (in directory "C:\\Nikesh\\Label\\LabelPrint"): 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.<init>(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

<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> 

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 Answers

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
Related