无法在Netbeans 7.1.2中运行DataApp示例应用程序

时间:2012-06-28 03:51:28

标签: xml netbeans

这是从示例javafx2.1软件包运行示例DataApp应用程序时面临的挑战:我正在运行Netbeans 7.1.2,javafx 2.1。,glassfish 3.1.2,Java EE6,并且我有6gig ram。

当我右键单击DataAppServer项目或我对DataAppClient项目执行相同操作并点击Run时,我收到以下错误消息:

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

我真的被困在这里了。需要帮忙。感谢。

1 个答案:

答案 0 :(得分:0)

这有助于: cannot build JavaFX 2.1.0 sample application - DataApp - failed to create task or type javafx:com.sun.javafx.tools.ant:application

..告诉你添加

          <taskdef resource="com/sun/javafx/tools/ant/antlib.xml"
             uri="javafx:com.sun.javafx.tools.ant"
             classpath="C:\Program Files\Oracle\JavaFX 2.1 SDK\lib\ant-javafx.jar" />

下的

 <target name="-post-jar" depends="-init-javafx, -jfx-copylibs">

在DataAppclient文件夹的build.xml文件中