之前一直用 ant,今天问了一下朋友怎么弄的,发现他使用的方式更加简洁明了
Eclipse->File->Export->java.Runnable JAR file
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project default="create_run_jar" name="Create Runnable Jar for Project GitGenSql">
<!--this file was created by Eclipse Runnable JAR Export Wizard-->
<!--ANT 1.7 is required -->
<target name="create_run_jar">
<jar destfile="/Users/xxx/Desktop/TestJar.jar" filesetmanifest="mergewithoutmain">
<manifest>
<attribute name="Main-Class" value="org.xxx.test.jar.entry.Main"/>
<attribute name="Class-Path" value="."/>
</manifest>
<fileset dir="/Users/xxx/Projects/TestJar/bin"/>
<zipfileset excludes="META-INF/*.SF" src="/Users/xxx/Projects/TestJar/libs/commons-io-2.1.jar"/>
<zipfileset excludes="META-INF/*.SF" src="/Users/xxx/Projects/TestJar/libs/PDFRenderer-0.9.1.jar"/>
</jar>
</target>
</project>