麻烦蚂蚁编译器

时间:2015-03-31 19:10:49

标签: java testing ant jar

今天我正在使用Fedora 21并且我安装了ant编译器,但是当我尝试测试时,就出现了这个问题。



[mhernandez@localhost practica1]$ ant test
Buildfile: /home/mhernandez/Estructuras de Datos/practica1/build.xml

compile.practica1:

practica1.jar:

test:

BUILD FAILED
/home/mhernandez/Estructuras de Datos/practica1/build.xml:63: Problem: failed to create task or type junit
Cause: the class org.apache.tools.ant.taskdefs.optional.junit.JUnitTask was not found.
        This looks like one of Ant's optional components.
Action: Check that the appropriate optional JAR exists in
        -/usr/share/ant/lib
        -/home/mhernandez/.ant/lib
        -a directory added on the command line with the -lib argument

Do not panic, this is a common problem.
The commonest cause is a missing JAR.

This is not a bug; it is a configuration problem


Total time: 0 seconds




问题是我不知道如何将丢失的jar放在该文件夹中。我已经从ant.apache.org下载了.zip,我有所有的jar,我只是想把它们放在正确的文件夹中。

1 个答案:

答案 0 :(得分:0)

可能您使用yum安装了ant,并且缺少一些jar。这种丢失是由于没有更新存储库或下载问题引起的。

最好你可以下载ant的存档文件。然后提取它并放置您的电脑的任何位置。然后手动设置ANT_HOME -

exprot ANT_HOME = /path/where/extracted/archived/placed
export PATH = $ANT_HOME/bin:$PATH  
相关问题