javap issue

S

S.Marion

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
 
T

Thomas Hawtin

S.Marion said:
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
 
S

S.Marion

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
 
C

Chris Uppal

S.Marion said:
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
 
S

S.Marion

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
 
T

Thomas Hawtin

S.Marion said:
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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top