如何从.jar文件中提取的.class文件? [英] How can I extract .class files from .jar files?

查看:305
本文介绍了如何从.jar文件中提取的.class文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有一个快速的问题:我喜欢这一点蚂蚁的外观:

A quick question: I like the look of this bit of Ant:

<fileset dir="${lib}">  
   <patternset refid="myPattern" />  
</fileset>

所以,我可以用这个例如几个.jar文件从$ {}的lib那场比赛myPattern复制。

So I could use this e.g. to copy a few .jar files from ${lib} that match myPattern.

如果我真正想要的是寻找到每一个的.jar在$ {} lib目录,并选择符合myPattern只有.class文件?

What if what I really want is to look into each .jar in ${lib} and select only .class files that match myPattern?

推荐答案

不能解压缩 任务做了你想在这里开箱即用的多是什么pretty。使用文件集来指定要从中提取的jar文件和 patternset 来指定哪些文件进行解压缩。

The unjar task does pretty much what you want here out of the box. Use a fileset to specify the jar files you want to extract from, and a patternset to specify which files to extract.

<unjar dest="${dest.dir}">
  <patternset refid="myPattern" />
  <fileset dir="${lib}" includes="*.jar" />
</unjar>

这篇关于如何从.jar文件中提取的.class文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆