我的系统上安装了以下内容 -
Java version "1.7.0_09"
JavaFX 2.0 SDK
NetBeans 7.2.1
当我尝试使用 ANT 编译代码时,它会显示错误消息 -
Could not load definitions from resource com/sun/javafx/tools/ant/antlib.xml. It could not be found.
Build.XML 包含
<project name="XYZ" default="XYZ" basedir="XYZ" xmlns:fx="javafx:com.sun.javafx.tools.ant">
<description>
simple example build file
</description>
<!-- set global properties for this build -->
<property name="srcXYZGenerator" location="src/XYZGenerator"/>
<property name="classpath" location="lib/XYZLib.jar;lib/ABC.jar;lib/IJK.jar;"/>
<target name="init">
<!-- Create the time stamp -->
<tstamp/>
<!-- Create the build directory structure used by compile -->
<mkdir dir="${buildXYZ}"/>
</target>
<target name="XYZ" depends="init">
<!-- Compile the java code from ${src} into ${build} -->
<taskdef resource="com/sun/javafx/tools/ant/antlib.xml"
uri="javafx:com.sun.javafx.tools.ant" classpath=".:C:\Program Files\Java\jdk1.7.0_09\lib\ant-javafx.jar"/>
<javac classpath="${classpath}" srcdir="${srcXYZ}" destdir="${buildXYZ}"/>
</target>
</project>
其他编译错误:
[javac] C:\Users\JavaUser4\Desktop\XYX2012.12FX\XYZ\src\Utility\net\XYZ\javafx\queue\DefaultStatisticsHandlerController.java:19: error: package javafx.scene does not exist
[javac] import javafx.scene.Node;
[javac] ^
[javac] C:\Users\JavaUser4\Desktop\XYZ2012.12FX\XYZ\src\Utility\net\XYZ\javafx\queue\DefaultStatisticsHandlerController.java:20: error: package javafx.scene.control does not exist
[javac] import javafx.scene.control.Button;
[javac] ^
[javac] C:\Users\JavaUser4\Desktop\XYZ2012.12FX\XYZ\src\Utility\net\XYZ\javafx\queue\DefaultStatisticsHandlerController.java:21: error: package javafx.scene.control does not exist
[javac] import javafx.scene.control.Label;
[javac] ^
[javac] C:\Users\JavaUser4\Desktop\XYZ2012.12FX\XYZ\src\Utility\net\XYZ\javafx\queue\DefaultStatisticsHandlerController.java:22: error: package javafx.scene.input does not exist
[javac] import javafx.scene.input.MouseEvent;