javap issue

Discussion in 'Java' started by S.Marion, Feb 28, 2006.

  1. S.Marion

    S.Marion Guest

    Hello,

    I have a slightly odd problem here.
    I'm trying to decompile the class file java/util/TimeZone .
    Specifically, I'm interested in the method :
    static synchronized HashMap timezones()

    I do have the java source file, and indeed, the method is in the file.
    However, when I "javap -c -private java/util/TimeZone" There's no way I
    can get my hand on the method.
    javap does simply not output it.
    I made sure he is looking for the appropriate class file.

    I have no idea what's wrong with this thing.

    Does anyone have any thoughts?

    Cheers,

    Sebastien
    S.Marion, Feb 28, 2006
    #1
    1. Advertising

  2. S.Marion wrote:
    >
    > I have a slightly odd problem here.
    > I'm trying to decompile the class file java/util/TimeZone .
    > Specifically, I'm interested in the method :
    > static synchronized HashMap timezones()
    >
    > I do have the java source file, and indeed, the method is in the file.
    > However, when I "javap -c -private java/util/TimeZone" There's no way I
    > can get my hand on the method.
    > javap does simply not output it.
    > I made sure he is looking for the appropriate class file.


    Which version of which implementation of Java are you using? I can't see
    a method like that in Sun's code.

    Are you absolutely sure javap is using class files produced with your
    source?

    Tom Hawtin
    --
    Unemployed English Java programmer
    http://jroller.com/page/tackline/
    Thomas Hawtin, Feb 28, 2006
    #2
    1. Advertising

  3. S.Marion

    S.Marion Guest

    Hi,

    I'm using the following version of javap implementation:
    Java(TM) 2 Runtime Environment, Standard Edition (build Blackdown-1.4.2-03)

    You actually do have a point here, this library is part of GNU's
    classpath built for JikesRVM.

    I am confident the version of the class file i'm checking was generated
    from the earlier specified .java file.


    Cheers,

    Sebastien


    Thomas Hawtin wrote:

    >
    > Which version of which implementation of Java are you using? I can't see
    > a method like that in Sun's code.
    >
    > Are you absolutely sure javap is using class files produced with your
    > source?
    >
    > Tom Hawtin
    S.Marion, Feb 28, 2006
    #3
  4. S.Marion

    Chris Uppal Guest

    S.Marion wrote:

    > I am confident the version of the class file i'm checking was generated
    > from the earlier specified .java file.


    Javap has a classpath-like concept to tell it where to look for stuff. Perhaps
    its finding the classfile on the standard classpath before your intended code.

    -- chris
    Chris Uppal, Feb 28, 2006
    #4
  5. S.Marion

    S.Marion Guest

    I can't believe it !
    You are right, thank's for the help.
    The reason why I said I was using the appropriate class is because i was
    in fact doing :
    /usr/local/j2sdk1.4.1/bin/javap -private -classpath . java/util/TimeZone

    Unfortunately, where I got mistaken is that I was using the -classpath
    option and not bootclasspath option (which made the difference!).

    Thank's again for help.

    Sebastien Marion



    Thomas Hawtin wrote:

    > You may be falling foul of the way javap looks for classes. It's
    > probably looking at it's own boot classes first. It appears that you can
    > get around with the problem with either:
    >
    > javap -bootclasspath . java/util/TimeZone
    >
    > or bizarrely:
    >
    > javap ./java/util/TimeZone
    >
    > Tom Hawtin
    S.Marion, Feb 28, 2006
    #5
  6. S.Marion wrote:
    >
    > You actually do have a point here, this library is part of GNU's
    > classpath built for JikesRVM.
    >
    > I am confident the version of the class file i'm checking was generated
    > from the earlier specified .java file.


    You may be falling foul of the way javap looks for classes. It's
    probably looking at it's own boot classes first. It appears that you can
    get around with the problem with either:

    javap -bootclasspath . java/util/TimeZone

    or bizarrely:

    javap ./java/util/TimeZone

    Tom Hawtin
    --
    Unemployed English Java programmer
    http://jroller.com/page/tackline/
    Thomas Hawtin, Feb 28, 2006
    #6
    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. Chandresh Prakash
    Replies:
    1
    Views:
    1,924
    Jeffrey Palm
    Dec 5, 2003
  2. Deshaies
    Replies:
    8
    Views:
    488
    Roedy Green
    Apr 26, 2004
  3. Albretch
    Replies:
    4
    Views:
    897
    Larry Barowski
    Oct 2, 2004
  4. TenderHeart

    java assembler?? for Javap utility??

    TenderHeart, Apr 29, 2005, in forum: Java
    Replies:
    1
    Views:
    679
    =?ISO-8859-1?Q?Daniel_Sj=F6blom?=
    Apr 29, 2005
  5. S.Marion
    Replies:
    2
    Views:
    489
    Roedy Green
    Mar 3, 2006
Loading...

Share This Page