Re: How to print out the currently used JAR file path to verify itis using right JAR?

Discussion in 'Java' started by markspace, Oct 7, 2011.

  1. markspace

    markspace Guest

    On 10/7/2011 7:25 AM, www wrote:
    > Just to add more details about my question:
    >
    > In my code, I am using class Abc, which is from 3rd party JAR
    > file(MyJAR.jar). I hope to print out Abc's class path to see it is
    > from a/b/MyJAR.old.jar or from c/d/MyJAR.new.jar
    >
    > I understand the correct way is to check the classpath



    Shouldn't you just be setting this from the command line or in the main
    Jar file? I'm a little confused by your question. You should know the
    class path before the program starts executing.

    Can you just search the existing class path for occurrences of this
    class "Abc"?
     
    markspace, Oct 7, 2011
    #1
    1. Advertising

  2. markspace

    Lew Guest

    Re: How to print out the currently used JAR file path to verify it isusing right JAR?

    markspace wrote:
    > www wrote:
    >> Just to add more details about my question:
    >>
    >> In my code, I am using class Abc, which is from 3rd party JAR
    >> file(MyJAR.jar). I hope to print out Abc's class path to see it is
    >> from a/b/MyJAR.old.jar or from c/d/MyJAR.new.jar
    >>
    >> I understand the correct way is to check the classpath

    >
    > Shouldn't you just be setting this from the command line or in the main
    > Jar file? I'm a little confused by your question. You should know the
    > class path before the program starts executing.
    >
    > Can you just search the existing class path for occurrences of this
    > class "Abc"?


    System.getProperty("java.class.path")
    <http://download.oracle.com/javase/7/docs/api/java/lang/System.html#getProperty(java.lang.String)>

    --
    Lew
     
    Lew, Oct 7, 2011
    #2
    1. Advertising

  3. markspace

    markspace Guest

    On 10/7/2011 9:37 AM, www wrote:
    > In one machine, Abc is loaded from B.jar and in
    > another machine, loaded from F.jar.



    How are you running this A.jar such that you don't know that F.jar is in
    the path? I'm honestly curious; diagnosing installation problems like
    this is not my strong suit.
     
    markspace, Oct 7, 2011
    #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. Replies:
    1
    Views:
    329
    Laurent Bugnion [MVP]
    Jan 17, 2007
  2. Replies:
    0
    Views:
    734
  3. Tim Golden
    Replies:
    0
    Views:
    816
    Tim Golden
    Oct 11, 2006
  4. harryos
    Replies:
    2
    Views:
    446
    harryos
    Mar 11, 2011
  5. Arne Vajhøj
    Replies:
    0
    Views:
    745
    Arne Vajhøj
    Nov 6, 2011
Loading...

Share This Page