Q:

Javafx deployment failed. Can not find JDK artifacts in specified location: C:\Program Files\Java\jre1.8.0

This is my first project on JavaFX. I am using eclipse to build my project as exe file. I am almost done. but I cant find out what is the problem I had now.
my ant build file code is here.
<?xml version="1.0" encoding="UTF-8"?>
<project name="Feel Free" default="do-deploy" basedir="."  xmlns:fx="javafx:com.sun.javafx.tools.ant">
<target name="init-fx-tasks">
    <path id="fxant">
        <filelist>
            <file name="C:\Program Files\Java\jdk1.8.0_66\lib\ant-javafx.jar"/>
            <file name="C:\Program Files\Java\jdk1.8.0_66\jre\lib\ext\jfxrt.jar"/>
            <file name="${basedir}"/>
        </filelist>
    </path>

    <taskdef resource="com/sun/javafx/tools/ant/antlib.xml"
        uri="javafx:com.sun.javafx.tools.ant"
        classpathref="fxant"/>
</target>
<target name="setup-staging-area">
    <delete dir="externalLibs" />
    <delete dir="project" />
    <delete dir="projectRefs" />

    <mkdir dir="externalLibs" />

    <copy todir="externalLibs">
        <fileset dir="C:\Program Files\Java\jdk1.8.0_66\lib">
            <filename name="java-json.jar"/>
        </fileset>
    </copy>

    <mkdir dir="project" />
    <copy todir="project">
        <fileset dir="C:\Users\Bhuvanesh\workspace\Feel Free">
            <include name="src/**" />
        </fileset>
    </copy>

    <mkdir dir="projectRefs" />
</target>
<target name='do-compile'>
    <delete dir="build" />
    <mkdir dir="build/src" />
    <mkdir dir="build/libs" />
    <mkdir dir="build/classes" />

    <!-- Copy project-libs references -->
    <copy todir="build/libs">
        <fileset dir="externalLibs">
            <include name="java-json.jar"/>
        </fileset>
    </copy>

    <!-- Copy project references -->

    <!-- Copy project sources itself -->
    <copy todir="build/src">
        <fileset dir="project/src">
            <include name="**/*"/>
        </fileset>
    </copy>

    <javac includeantruntime="false" source="1.8" target="1.8" srcdir="build/src" destdir="build/classes" encoding="Cp1252">
        <classpath>
            <fileset dir="build/libs">
                <include name="*"/>
            </fileset>
        </classpath>
    </javac>

    <!-- Copy over none Java-Files -->
    <copy todir="build/classes">
    <fileset dir="project/src">
        <exclude name="**/*.java"/>
    </fileset>
    </copy>

</target>
<target name="do-deploy" depends="setup-staging-area, do-compile, init-fx-tasks">
    <delete file="dist"/>
    <delete file="deploy" />

    <mkdir dir="dist" />
    <mkdir dir="dist/libs" />

    <copy todir="dist/libs">
        <fileset dir="externalLibs">
            <include name="*" />
        </fileset>
    </copy>

    <fx:resources id="appRes">
        <fx:fileset dir="dist" includes="Feel Free.jar"/>
        <fx:fileset dir="dist" includes="libs/*"/>
        <fx:fileset dir="dist" includes="resources/**"/>    
    </fx:resources>

    <fx:application id="fxApplication"
        name="Feel Free"
        mainClass="application.Main"
        version="1.0"
    />

    <mkdir dir="build/classes/META-INF" />

    <fx:jar destfile="dist/Feel Free.jar">
        <fx:application refid="fxApplication"/>
        <fileset dir="build/classes">
        </fileset>
        <fx:resources refid="appRes"/>

        <manifest>
            <attribute name="Implementation-Vendor" value="Bhuan Tech"/>
            <attribute name="Implementation-Title" value="Feel Free"/>
            <attribute name="Implementation-Version" value="1.0"/>
            <attribute name="JavaFX-Feature-Proxy" value="None"/>
        </manifest>
    </fx:jar>

    <mkdir dir="deploy" />
    <!-- Need to use ${basedir} because somehow the ant task is calculating the directory differently -->
    <fx:deploy
        embedJNLP="false"
        extension="false"
        includeDT="false"
        offlineAllowed="true"
        outdir="${basedir}/deploy"
        outfile="Feel Free" nativeBundles="exe"
        updatemode="background" >
        <fx:platform basedir="${java.home}"/>
        <fx:info title="Feel Free" vendor="Bhuan Tech"/>

        <fx:application refId="fxApplication"/>
        <fx:resources refid="appRes"/>
    </fx:deploy>

</target>

And the error message is:
    Buildfile: C:\Users\Bhuvanesh\workspace\Feel Free\build\build.xml
    setup-staging-area:
       [delete] Deleting directory C:\Users\Bhuvanesh\workspace\Feel Free\build\externalLibs
       [delete] Deleting directory C:\Users\Bhuvanesh\workspace\Feel Free\build\project
       [delete] Deleting directory C:\Users\Bhuvanesh\workspace\Feel Free\build\projectRefs
        [mkdir] Created dir: C:\Users\Bhuvanesh\workspace\Feel Free\build\externalLibs
         [copy] Copying 1 file to C:\Users\Bhuvanesh\workspace\Feel Free\build\externalLibs
        [mkdir] Created dir: C:\Users\Bhuvanesh\workspace\Feel Free\build\project
         [copy] Copying 14 files to C:\Users\Bhuvanesh\workspace\Feel Free\build\project
        [mkdir] Created dir: C:\Users\Bhuvanesh\workspace\Feel Free\build\projectRefs
    do-compile:
       [delete] Deleting directory C:\Users\Bhuvanesh\workspace\Feel Free\build\build
        [mkdir] Created dir: C:\Users\Bhuvanesh\workspace\Feel Free\build\build\src
        [mkdir] Created dir: C:\Users\Bhuvanesh\workspace\Feel Free\build\build\libs
        [mkdir] Created dir: C:\Users\Bhuvanesh\workspace\Feel Free\build\build\classes
         [copy] Copying 1 file to C:\Users\Bhuvanesh\workspace\Feel Free\build\build\libs
         [copy] Copying 14 files to C:\Users\Bhuvanesh\workspace\Feel Free\build\build\src
        [javac] Compiling 3 source files to C:\Users\Bhuvanesh\workspace\Feel Free\build\build\classes
         [copy] Copying 11 files to C:\Users\Bhuvanesh\workspace\Feel Free\build\build\classes
    init-fx-tasks:
    do-deploy:
         [copy] Copying 1 file to C:\Users\Bhuvanesh\workspace\Feel Free\build\dist\libs
        [mkdir] Created dir: C:\Users\Bhuvanesh\workspace\Feel Free\build\build\classes\META-INF

BUILD FAILED
C:\Users\Bhuvanesh\workspace\Feel Free\build\build.xml:131: Can not find JDK artifacts in specified location: C:\Program Files\Java\jre1.8.0_66

Total time: 2 seconds

A:

Tell the eclipse to use JDK insted of JRE, because jre doesn't have all library jar files.
In Eclipse, select the Window menu->Preferences.  Then select Java->Installed JRE’s.  Then click Add… select Standard VM then click Next.  In the JRE home, navigate to the folder you’ve installed the JDK to ( c:\Program Files\Java\jdk1.6.0_21). 
Reference: link

