Find a jar file given the class name?

后端 未结 17 2016
无人共我
无人共我 2020-11-29 18:46

This must be a very basic question for Java developers, but what is the best way to find the appropriate jar file given a class name?

For example, give

17条回答
  •  渐次进展
    2020-11-29 19:40

    In Windows, run cmd.exe and type:

      for %i in (*.jar) do @jar tvf %i | find "/com/company/MyClass.class"
    

    The jars would have to be in the current directory. For also has a /R option which takes a directory and lets you search recursively.

    If Jar.exe isn't in your path, you can do something like @C:\jdk\bin\jar.exe.

提交回复
热议问题