Wink Saville’s Blog

December 23, 2007

Java – using javap

Filed under: java,programming — wink @ 12:30 pm

I wanted to disassemble a class using javap but unzipping android.jar navigating to android/os where Message.class resided and then executing:

javap -c Message.class

results in:

Couldnot find Message.class

I then searched for <javap Could not find> and found that specifying the class path and then the package name worked:

javap -c -classpath ~/android/android_sdk_linux_m3-rc37a/android.jar android.os.Message

Also, I could specify the unzipped jar, assume android.jar unzipped to android.xx and that works also:

javap -c -classpath ~/android/android_sdk_linux_m3-rc37a/android.xx android.os.Message

And the simplest was cd’ing into the directory with message and using “.” for classpath, that worked also:

cd android.xx/android/os/
javap -c -classpath . Message

Actually it turns out that if we go back to the original attempt but don’t leave off .class all is well , so assuming were still in android.xx/android/os then we just need:

javap -c Message

No Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URL

Leave a comment

Powered by WordPress