Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » How does eclipse display java bytecode?(I'd like to show the bytecode result in console)
How does eclipse display java bytecode? [message #1078847] Sat, 03 August 2013 17:33
Zhenyu Zhou is currently offline Zhenyu ZhouFriend
Messages: 1
Registered: August 2013
Junior Member
Hi all,

Now I'd like to read the content in the class file(i.e. java bytecode file). And I find that the result giving by javap is quite different from the one showing in eclipse directly. So could you please help me to get the "eclipse-style" result in the console? That is to say, I'm wondering what eclipse uses instead of javap to show the bytecode content and how to use it in the console.

Here is part of the result from javap:
0: ldc_w #259; //String
3: astore_1
4: aload_0
5: iconst_0
6: putfield #121; //Field i:I
9: goto 57
12: new #187; //class java/lang/StringBuffer
15: dup
16: aload_1
17: invokestatic #261; //Method java/lang/String.valueOf:(Ljava/lang/Object;)Ljava/lang/String;

And here is another part of bytecode of "eclipse type":
16 new java.io.FileReader [115]
19 dup
20 getstatic Cancer.f1 : java.io.File [111]
23 invokespecial java.io.FileReader(java.io.File) [117]
26 invokespecial java.io.BufferedReader(java.io.Reader) [120]
29 astore_0 [reader]
30 aload_0 [reader]
31 invokevirtual java.io.BufferedReader.readLine() : java.lang.String [123]
34 astore_1 [temp]
35 aload_1 [temp]
36 invokestatic java.lang.Integer.parseInt(java.lang.String) : int [127]
39 putstatic Cancer.totalNumSingle : int [133]
42 iconst_0
43 istore 8 [i]

You can see that the variable is available here. With eclipse I just use File->Open File and select the class file. It seems that eclipse has its own class file editor.

Thanks!
Previous Topic:Forever Indexing
Next Topic:convert an open source from c to java
Goto Forum:
  


Current Time: Thu Apr 18 23:47:27 GMT 2024

Powered by FUDForum. Page generated in 0.02942 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top