在不同文件夹(窗口)中的大量jar文件组中找到一个类的建议方法是什么? 目前我使用editplus搜索,这似乎很棒。但也许我错过了一个更好的方法?
谢谢。
编辑 我需要找到它不是编程式。在一大群罐子里找到一个特定的类
回答
尝试cf.jar
Usage:
java -jar cf.jar SEARCH [DIRECTORY] [OPTIONS]...
Searches all JAR files in the current directory and its sub-directories for
entries matching the SEARCH argument. If DIRECTORY is provided, searching will
be done in that location instead of the current directory.
SEARCH:
A search string containing the class name (entry name). Wild card (*) is
supported. Package separator can be either of `/', `\' or `.'.
Examples:
java.lang.String
java/util/ArrayList
java/lang/Str*B*er
If non ".class" entries also need to be searched, option -a (--all-types)
should be specified. Please see the OPTIONS section for a more detailed
explanation.
DIRECTORY:
If this is not provided, current directory and all its sub-directories will
be used for performing the search. However, if this argument is provided,
the same and its sub-directories will be used as the location to fetch JAR
files from.
If a recursive scan is not needed, option -s (--shallow) can be specified.
OPTIONS:
-h --help
Shows this help
-o [path] --redirect-output
Redirect output to a file path supplied.
-x [x1,x2] --archive-extensions
Extensions in addition to the default ".jar". Comma or space
separated list accepted.
-i --insensitive-case
Case insensitive search.
-q --quiet
Silent search without the progress bar animation.
-a --all-types
Removes the filtering on ".class" types so that other types
such as ".properties", ".xml", etc can also be searched for.
-s --shallow
Performs a shallow search. Doesn't recurse.
Examples:
java -jar cf.jar org/apache/log4j/Level D:\Frameworks
java -jar cf.jar *OracleDriver C:\oracle -x jar,zip
java -jar cf.jar messages.properties D:\IBM\WebSphere -a -x jar,war,ear
java -jar cf.jar util.* D:\Java -i -q
不错。我会尝试 。 – Jeb 2011-04-14 07:49:24
jars=/opt/java/jre/lib/ext/mail.jar:/opt/java/jre/lib/ext/postgresql.jar
for jar in $(echo $jars | sed 's/:/ /g'); do
jar -tf $jar | grep Driver && echo $jar
done
对于Windows,请替换:with;在“罐子” - 可变和sed命令。 sed是gnu工具的一部分 - 它们有一个二进制win32端口,它包含grep,sed,sh.exe和更多有用的工具。
将驱动程序替换为%1以使其成为可参数化的脚本。
我会使用在线搜索工具,如
谢谢。虽然我的意思是在m本地硬盘上搜索,但它仍然有用 – Jeb 2011-04-14 07:50:45
@ user450602我知道这对你的具体问题并不是一个好答案,但作为其他人的参考,这是一个有效的答案 – 2011-04-14 10:16:51
由于您使用的IntelliJ您可以导航到该班问题(Go To - > Class ...)和t母鸡在项目视图中显示(Alt-F1 - >项目视图)。
不知道。谢谢。 – Jeb 2011-04-14 07:49:42
如果你已经有罐子,我建议使用JD GUI。
只需打开罐子(将所有罐子拖放到UI中),然后按CTRL + SHIFT + T.输入类名,并获得该类所在的所有jar的列表。
如果您知道类名,但不是jar,请使用搜索maven工具。 http://search.maven.org/
对于商业客户,我通常使用maven。我建立了一个inora nexus存储库,然后使用它的搜索。
如果该项目是建立在Eclipse,使用Ctrl + Shift + T,然后键入类名
如果该项目是在IntellJ,用CTRL + N和输入类名
- 1. 如何在一堆罐子里找到类名
- 2. 的Maven在一个罐子里
- 3. 加载包含在一个罐子里
- 4. 在另一个罐子里面运行外部罐子
- 5. 如何在Cobertura中的罐子里只安装特定的类?
- 6. Grails在罐子里找不到课程
- 7. 为什么Spark无法找到这个罐子里的类?
- 8. 编译一个Eclipse项目到一个罐子里
- 9. 将一个文件夹附加到一个罐子里
- 10. 查找罐子里面的特定路径
- 11. jQuery - 找到一个特定的类的孩子
- 12. 不能getResourcesAsStream()从一个文件夹(在一个罐子里)
- 13. 在一个罐子里搜索一个文件
- 14. jQuery:找到具有特定类的最后一个孩子
- 15. IntelliJ IDEA在项目罐子里找到类
- 16. 在另一台机器上从一个罐子里加载一个班级,而无需下载整个罐子
- 17. 查找特定类的下一个元素父里面jQuery的
- 18. 包括一个Excel文件和调用一次打包到一个罐子里
- 19. 定义在捆绑一个罐子蚂蚁主类的混乱
- 20. 我在哪里可以找到这个罐子:commons-csv 0.1-524170
- 21. 我怎么能从另一个罐子里面的shell脚本里面调用一个jar里面的java类
- 22. 哪个文件在一个罐子里读取参数
- 23. 如何找到一个特定的类,并找到一个特定的元素,并添加禁用attr
- 24. 检查这一个罐子类扩展一个抽象类
- 25. 类实现在一个罐子里的接口,但不覆盖的方法
- 26. 在div下找到一个特定的类来处理子元素
- 27. 在Watir找到一个特定类别的div列表
- 28. 特拉维斯部署一个zip而不是一个罐子
- 29. 执行类时未找到罐子
- 30. Mongoose.js找到()一个在里面找()
是你试图以编程的方式做到这一点,或者只是在你选择的文件浏览器/编辑器中? – 2011-04-13 16:02:11
如果你使用Eclipse,你可以在eclipse中做Ctrl + T – 2011-04-13 16:02:19
'CTRL + SHIFT + T'。 – Bozho 2011-04-13 16:13:18