我加commons-codec.1.2.jar
到我的Java構建路徑添加的jar庫文件到Ant構建
[javac] C:\Users\souzamor\workspace\tczip\src\tczip\Tczip.java:190: error: c
annot find symbol
[javac] mdEnc = new String(Hex.encodeHex(diges
t));
[javac] ^
這裏是我build.xml
文件:
<?xml version="1.0" encoding="UTF-8"?>
<project>
<target name="clean">
<delete dir="build" />
</target>
<target name="compile">
<mkdir dir="build/classes" />
<javac srcdir="src" destdir="build/classes" />
</target>
<target name="jar">
<mkdir dir="build/jar" />
<jar destfile="build/jar/Tczip.jar" basedir="build/classes">
<manifest>
<attribute name="Main-Class" value="tczip.ZipComparison" />
</manifest>
</jar>
</target>
<target name="run">
<java jar="build/jar/Tczip.jar" fork="true" />
</target>
</project>
我怎麼能添加jar文件到build.xml
文件??我也有另外一個Java
類稱爲Tczip
哪些進程MD5
:
[java] Processing: bhmcommonclient.zip
[java] Exception in thread "main" java.lang.NoClassDefFoundError: org/apach
mmons/codec/binary/Hex
[java] at tczip.Tczip.digest(Unknown Source)
[java] at tczip.Tczip.execute(Unknown Source)
[java] at tczip.ZipComparison.showFiles(Unknown Source)
[java] at tczip.ZipComparison.showFiles(Unknown Source)
[java] at tczip.ZipComparison.showFiles(Unknown Source)
[java] at tczip.ZipComparison.showFiles(Unknown Source)
[java] at tczip.ZipComparison.showFiles(Unknown Source)
[java] at tczip.ZipComparison.matchMD5(Unknown Source)
[java] at tczip.ZipComparison.main(Unknown Source)
我不認爲我補充說,正確的到我的jar文件...我怎麼能做到這一點?我完全新Ant
我將創建一個' jar'文件,這將是一個庫文件...但編譯我需要添加另一個'jar'到我的路徑... – cybertextron
請參閱:http://stackoverflow.com/questions/722774/getting-ant-javac -to-recognized-a-classpath – davidmontoyago