开发者

javap -l option cannot display line number info

The javap command has several options, one of them is -l, which can print line number and local varia开发者_运维技巧ble tables. Suppose a java program has been compiled successfully and there is the file "Main.class", so running javap -l Main can produce something like:

public static void main(java.lang.String[]);

LineNumberTable:
 line 100: 0
 line 101: 27
 line 275: 54

LocalVariableTable:
 Start Length Slot Name Signature
 0     55     0    args  [Ljava/lang/String;

However, I'm using this javap -l xxx command on the class files of one java program, but the area of line number and local variable table is empty (which shouldn't be). The javap command and other options such as -s, -verbose works fine, but only the line info area corresponding to the -l option is empty.

Has anyone ever encountered such weird case?


Use -g to compile your code, otherwise the line numbers are not kept (akin to the stack trace displaying "compiled code" instead of the line number)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜