如何将CLASS文件打包成JAR文件
如何将CLASS文件打包成JAR文件??
------解决方案--------------------jar命令,jar cvf test.jar A.class B.class
------解决方案--------------------在eclipse里项目的根目录下新建一个build.xml文件
<?xml version= "1.0 " encoding= "UTF-8 "?>
<project name= "naf " default= "build.jar " basedir= ". ">
<property name= "tempSrc " value= "${basedir}/../../tempSrc "/>
<property name= "baseSrc " value= "${basedir}/WebRoot/WEB-INF/classes "/>
<target name= "build.jar " >
<delete dir= "${tempSrc} "/>
<mkdir dir= "${tempSrc} "/>
<zip destfile= "${tempSrc}/naf_1.0.0.jar " basedir= "${baseSrc} " filesonly= "false " whenempty= "skip " update= "false "/>
</target>
</project>
把变量中的路径改成你自己的
右键run -》ant build
------解决方案--------------------gen.包A.1,按路径一个一个的写下来.