我添加commons-codec.1.2.jar
到我的 Java 构建路径
[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
which processes的类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