<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    紙飛機

      BlogJava :: 首頁 :: 新隨筆 :: 聯(lián)系 :: 聚合  :: 管理 ::
      22 隨筆 :: 28 文章 :: 30 評論 :: 0 Trackbacks
    今天在試著在eclipse中使用Ant來運行JUnit進行單元測試時彈出如下錯誤提示,但在外部窗口執(zhí)行Ant時不會出現(xiàn)

    BUILD FAILED
    D:\EclipseWorkSpace\message\build.xml:
    11: Could not create task or type of type: junit.

    Ant could not find the task or a 
    class this task relies upon.

    This is common and has a number of causes; the usual 
    solutions are to read the manual pages then download and
    install needed JAR files, or fix the build file: 
     - You have misspelt 'junit'.
       Fix: check your spelling.
     - The task needs an external JAR file to execute
         and this is not found at the right place in the classpath.
       Fix: check the documentation for dependencies.
       Fix: declare the task.
     - The task is an Ant optional task and the JAR file and/or libraries
         implementing the functionality were not found at the time you
         yourself built your installation of Ant from the Ant sources.
       Fix: Look in the ANT_HOME/lib for the 'ant-' JAR corresponding to the
         task and make sure it contains more than merely a META-INF/MANIFEST.MF.
         If all it contains is the manifest, then rebuild Ant with the needed
         libraries present in ${ant.home}/lib/optional/ , or alternatively,
         download a pre-built release version from apache.org
     - The build file was written for a later version of Ant
       Fix: upgrade to at least the latest release version of Ant
     - The task is not an Ant core or optional task 
         and needs to be declared using <taskdef>.
     - You are attempting to use a task defined using 
        <presetdef> or <macrodef> but have spelt wrong or not 
       defined it at the point of use

    Remember that for JAR files to be visible to Ant tasks implemented
    in ANT_HOME/lib, the files must be in the same directory or on the
    classpath

    Please neither file bug reports on this problem, nor email the
    Ant mailing lists, until all of these causes have been explored,
    as this
     is not an Ant bug.

    按著錯誤提示將JUnit.jar放在ANT_HOME/lib中還是同樣出現(xiàn)上述錯誤提示
    這是因為<junit>任務(wù)在ant中是一個optinal task,非core task,需要junit.jar支持

    解決方法:在window --> preferences --> Ant --> Runtime --> Classpath中選擇Global Entries,然后添加JUnit.jar文件即可,以便eclipse在運行ant任務(wù)時會加載junit.jar,這樣就可以解決上述問題現(xiàn)象,其實這里也可以將JUnit.jar文件放在Ant Home Entries,但這樣有可能造成與Ant本身包的混淆.


    ok

    posted on 2007-07-19 22:41 紙飛機 閱讀(2059) 評論(3)  編輯  收藏

    評論

    # re: Eclipse中使用Ant來運行Junit的錯誤及解決方法 2008-07-22 15:15 yhmymemory
    剛才試了一下很好.  回復(fù)  更多評論
      

    # re: Eclipse中使用Ant來運行Junit的錯誤及解決方法[未登錄] 2008-12-05 11:03 user
    謝謝  回復(fù)  更多評論
      

    # re: Eclipse中使用Ant來運行Junit的錯誤及解決方法[未登錄] 2009-07-24 11:25 ling
    很不錯。最近正為這個郁悶,現(xiàn)在解決了  回復(fù)  更多評論
      


    只有注冊用戶登錄后才能發(fā)表評論。


    網(wǎng)站導(dǎo)航:
     
    主站蜘蛛池模板: 凹凸精品视频分类国产品免费| 国产免费久久精品丫丫| 亚洲高清无在码在线电影不卡| 国产AV无码专区亚洲AV男同| 亚洲成av人影院| 久久久久免费精品国产| 中文字幕人成无码免费视频| 成人国产mv免费视频| 国产亚洲大尺度无码无码专线 | 亚洲AV无码之日韩精品| 亚洲成Av人片乱码色午夜| eeuss影院免费92242部| 精品无码人妻一区二区免费蜜桃| 日韩免费在线观看| 香蕉视频免费在线播放| 99久在线国内在线播放免费观看 | 日韩免费一区二区三区| 无套内谢孕妇毛片免费看看| 1000部免费啪啪十八未年禁止观看 | 久久国产色AV免费观看| 亚洲综合男人的天堂色婷婷| 国产成人1024精品免费| 亚洲精品国产字幕久久不卡| 国产亚洲视频在线| 永久免费AV无码国产网站| 亚洲AV无码一区二区大桥未久| 青青草无码免费一二三区| 亚洲国产精品乱码在线观看97| 久久一区二区三区免费| 亚洲国产精品国自产拍电影| 四虎影视久久久免费观看| 成人免费视频软件网站| 久久亚洲精品成人AV| 免费观看在线禁片| 亚洲香蕉久久一区二区三区四区| 全免费a级毛片免费看| 亚洲无线码一区二区三区| 春意影院午夜爽爽爽免费| 亚洲国产一区国产亚洲| 韩国免费三片在线视频| 波多野结衣亚洲一级|