这是从示例 javafx2.1 包运行示例 DataApp 应用程序时面临的挑战:我正在运行 Netbeans 7.1.2、javafx 2.1.、glassfish 3.1.2、Java EE6,并且我有 6gig ram。
当我右键单击 DataAppServer 项目或对 DataAppClient 项目执行相同操作并点击运行时,我收到以下错误消息:
C:\Users\Staples\Desktop\ITOWER STUDIO\javafx-samples-2.1.1\src\DataApp\DataAppServer\nbproject\build-impl.xml:533: The following error occurred while executing this line:
C:\Users\Staples\Desktop\ITOWER STUDIO\javafx-samples-2.1.1\src\DataApp\DataAppClient\build.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: 8 seconds)**
我尝试按照类似问题中的说明添加 taskdef 标记,但它给出了相同的错误。当我打开项目并连接到 MySQL 数据库时没有错误。这是我添加的 taskdef 标签:
<taskdef resource="com/sun/javafx/tools/ant/antlib.xml"
uri="javafx:com.sun.javafx.tools.ant"
classpath="C:\Program Files(x86)\Oracle\JavaFX 2.1 SDK\lib\ant-javafx.jar"/>
第 48 行显示了这个字符串:
preloaderClass="dataapppreloader.DataAppPreloader"/>
第 533 行显示:
<ant antfile="${project.DataAppClient}/build.xml" inheritall="false"target="jar">
我真的被困在这里了。需要帮忙。谢谢。