Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

Finding a class in a sea of JARS?

  • 27-05-2003 11:21AM
    #1
    Registered Users, Registered Users 2 Posts: 21,264 ✭✭✭✭


    Anyone know of a tool that can do this.

    Let's say I have 100 JAR's in various subdirectories. I'm looking for a class and I know the full import name. Is there a tool that will taking that information tell me what jars have that class in it (with the correct package path).


Comments

  • Registered Users, Registered Users 2 Posts: 1,186 ✭✭✭davej


    You can use a normal search.

    In windows:

    search for all *.jar files containing text "packagePath/x.class"

    In unix use find/locate and grep.

    davej


  • Registered Users, Registered Users 2 Posts: 21,264 ✭✭✭✭Hobbes


    So just use '/' intead of '.' ?


  • Registered Users, Registered Users 2 Posts: 15,443 ✭✭✭✭bonkey


    That should work Hobbes - a Jar being a glorified ZIP file, and having an internal directory structure to match the qualified class name.

    If you open any zip file, you'll find a fairly readable chunk at the top.

    There must be an easier way to do it though....

    jc


  • Registered Users, Registered Users 2 Posts: 107 ✭✭Balmark


    Download pkunzip.exe

    copy it to where your jars are

    type in dos box

    pkunzip *.jar com\my\package\MyClass.class -t

    and it'll tell you where it found it (-t for test)
    That or just do a text search on the .jar files with any text search (the windows search for files containing text works .. )

    Anyhow .. thats that ;)

    /Bal


Advertisement