Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > javap issue

Reply
Thread Tools

javap issue

 
 
S.Marion
Guest
Posts: n/a
 
      02-28-2006
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
 
Reply With Quote
 
 
 
 
Thomas Hawtin
Guest
Posts: n/a
 
      02-28-2006
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/
 
Reply With Quote
 
 
 
 
S.Marion
Guest
Posts: n/a
 
      02-28-2006
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

 
Reply With Quote
 
Chris Uppal
Guest
Posts: n/a
 
      02-28-2006
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


 
Reply With Quote
 
S.Marion
Guest
Posts: n/a
 
      02-28-2006
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

 
Reply With Quote
 
Thomas Hawtin
Guest
Posts: n/a
 
      02-28-2006
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/
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
javap: fully qualified names for "new" statements S.Marion Java 2 03-03-2006 01:32 AM
java assembler?? for Javap utility?? TenderHeart Java 1 04-29-2005 06:12 PM
mnemonics<->opcodes map and format of output of the javap utility Albretch Java 4 10-02-2004 07:31 PM
Java Web Start Security - Can others 'javap' our class files from client machine? Deshaies Java 8 04-25-2004 11:49 PM
Classpath problem: javap is able to locate one class in a jar but not the other. Chandresh Prakash Java 1 12-05-2003 12:43 PM



Advertisments