I am trying to build the DataApp sample application from the JavaFX 2.1.0 sample application pack downloadable from the official JafaFX downloads page:
http://www.oracle.com/technetwork/java/javafx/downloads/index.html
我用Netbeans 7.1.2, JDK6和JavaFX 2.1.0 来交换JDK6。
在 NetBeans 中, 当我右键点击 DataApp 服务器并从上下文菜单中选择运行时, 我得到以下输出 :
check-mysql-drivers-installed:
init:
deps-module-jar:
DataAppClient.init:
Deleting: D:Softjavafx-samples-2.1.0srcDataAppDataAppClientuilduilt-jar.properties
DataAppClient.deps-jar:
Updating property file: D:Softjavafx-samples-2.1.0srcDataAppDataAppClientuilduilt-jar.properties
DataAppLibrary.init:
DataAppLibrary.deps-jar:
Updating property file: D:Softjavafx-samples-2.1.0srcDataAppDataAppClientuilduilt-jar.properties
DataAppLibrary.compile:
Copy libraries to D:Softjavafx-samples-2.1.0srcDataAppDataAppLibrarydistlib.
To run this application from the command line without Ant, try:
java -jar "D:Softjavafx-samples-2.1.0srcDataAppDataAppLibrarydistDataAppLibrary.jar"
DataAppLibrary.jar:
Duplicated project name in import. Project jfx-impl defined first in D:Softjavafx-samples-2.1.0srcDataAppDataAppClient
bprojectjfx-impl.xml and again in D:Softjavafx-samples-2.1.0srcDataAppDataAppPreloader
bprojectjfx-impl.xml
DataAppPreloader.init:
DataAppPreloader.deps-jar:
Updating property file: D:Softjavafx-samples-2.1.0srcDataAppDataAppClientuilduilt-jar.properties
DataAppPreloader.compile:
Copying 1 file to D:Softjavafx-samples-2.1.0srcDataAppDataAppPreloaderuild
Copy libraries to D:Softjavafx-samples-2.1.0srcDataAppDataAppPreloaderdistlib.
To run this application from the command line without Ant, try:
C:jdk1.6.0_30/bin/java -jar "D:Softjavafx-samples-2.1.0srcDataAppDataAppPreloaderdistDataAppPreloader.jar"
Deleting directory D:Softjavafx-samples-2.1.0srcDataAppDataAppPreloaderdistlib
Detected JavaFX Ant API version 1.1
DataAppPreloader.jfx-deployment:
DataAppPreloader.jar:
DataAppClient.compile:
Copying 27 files to D:Softjavafx-samples-2.1.0srcDataAppDataAppClientdistlib
Moving 1 file to D:Softjavafx-samples-2.1.0srcDataAppDataAppClientdist
Expanding: D:Softjavafx-samples-2.1.0srcDataAppDataAppClientdistlibDataAppLibrary.jar into D:Softjavafx-samples-2.1.0srcDataAppDataAppClientuildclasses
Expanding: D:Softjavafx-samples-2.1.0srcDataAppDataAppClientdistlibjackson-core-asl-1.7.1.jar into D:Softjavafx-samples-2.1.0srcDataAppDataAppClientuildclasses
Expanding: D:Softjavafx-samples-2.1.0srcDataAppDataAppClientdistlibjackson-jaxrs-1.7.1.jar into D:Softjavafx-samples-2.1.0srcDataAppDataAppClientuildclasses
Expanding: D:Softjavafx-samples-2.1.0srcDataAppDataAppClientdistlibjackson-mapper-asl-1.7.1.jar into D:Softjavafx-samples-2.1.0srcDataAppDataAppClientuildclasses
Expanding: D:Softjavafx-samples-2.1.0srcDataAppDataAppClientdistlibjackson-xc-1.7.1.jar into D:Softjavafx-samples-2.1.0srcDataAppDataAppClientuildclasses
Expanding: D:Softjavafx-samples-2.1.0srcDataAppDataAppClientdistlibjersey-client-1.8.jar into D:Softjavafx-samples-2.1.0srcDataAppDataAppClientuildclasses
Expanding: D:Softjavafx-samples-2.1.0srcDataAppDataAppClientdistlibjersey-core-1.8.jar into D:Softjavafx-samples-2.1.0srcDataAppDataAppClientuildclasses
Expanding: D:Softjavafx-samples-2.1.0srcDataAppDataAppClientdistlibjersey-json-1.8.jar into D:Softjavafx-samples-2.1.0srcDataAppDataAppClientuildclasses
Deleting directory D:Softjavafx-samples-2.1.0srcDataAppDataAppClientdistlib
D:Softjavafx-samples-2.1.0srcDataAppDataAppServer
bprojectuild-impl.xml:559: The following error occurred while executing this line:
D:Softjavafx-samples-2.1.0srcDataAppDataAppClientuild.xml:48: Problem: failed to create task or type javafx:com.sun.javafx.tools.ant:application
Cause: The name is undefined.
Action: Check the spelling.
Action: Check that any custom tasks/types have been declared.
Action: Check that any <presetdef>/<macrodef> declarations have taken place.
No types or tasks have been defined in this namespace yet
BUILD FAILED (total time: 6 seconds)
有人知道这个错误吗?
会不会和蚂蚁有关?
以下几行意味着什么?
The following error occurred while executing this line:
D:Softjavafx-samples-2.1.0srcDataAppDataAppClientuild.xml:48: Problem: failed to create task or type javafx:com.sun.javafx.tools.ant:application
Cause: The name is undefined.
谢谢!
Update:
Aparently the problem is solved by manually modifying the Ant build.xml file located in the DataAppClient project root.
I added a taskdef tag at the beginning of the -post-jar target definition and the error was gone:
...
<target name="-post-jar" depends="-init-javafx, -jfx-copylibs">
<taskdef resource="com/sun/javafx/tools/ant/antlib.xml"
uri="javafx:com.sun.javafx.tools.ant"
classpath="d:Softjavafx_sdk_2.1libant-javafx.jar" />
<!-- Move preloader out of libs -->
<move file="${dist.dir}/lib/DataAppPreloader.jar" todir="${dist.dir}"/>
...
这是否是官方发布此试样应用程序时的错误, 还是我的设置有问题?