how to find jar file dependencies

Discussion in 'Java' started by vk02720, Oct 30, 2006.

  1. vk02720

    vk02720 Guest

    Given a jar file xyz.jar and a directory containing all other .jar
    files, how do I find out the dependent jar files of xyz.jar ?

    TIA.
    vk02720, Oct 30, 2006
    #1
    1. Advertising

  2. > Given a jar file xyz.jar and a directory containing all other .jar
    > files, how do I find out the dependent jar files of xyz.jar ?


    Nice question!

    One way is to look at the manifest file in the jar. Manifest files can
    be written with a "Class-Path" attribute that lists other resources
    (jars, class files) that the jar file expects to have in the same
    directory (or subdirectory etc, specified by a URL relative to the jar
    file).
    http://java.sun.com/docs/books/tutorial/deployment/jar/downman.html

    Another way is just to compile something that uses the jar you want -
    you will find out from the error messages (if anything) if there are
    external resources that cannot be found.

    Rob
    :)
    Robert Mark Bram, Oct 30, 2006
    #2
    1. Advertising

  3. vk02720

    jimmycheng603

    Joined:
    Mar 12, 2014
    Messages:
    1
    try findmaven.net, enter the jar name to find out the jar then click the dependency button to show the dependency tree of the jar
    jimmycheng603, Mar 12, 2014
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. James Alan Farrell
    Replies:
    6
    Views:
    9,692
    Andrew Thompson
    Jan 9, 2004
  2. Arnold Peters
    Replies:
    0
    Views:
    564
    Arnold Peters
    Jan 5, 2005
  3. muttley
    Replies:
    0
    Views:
    2,714
    muttley
    Oct 20, 2005
  4. cyberco
    Replies:
    4
    Views:
    3,748
    Roedy Green
    Feb 14, 2006
  5. Arnold Peters
    Replies:
    0
    Views:
    653
    Arnold Peters
    Jan 5, 2005
Loading...

Share This Page