1

In our product there are a few jdk 1.6.0._17 compiled java source files. They are not giving the line numbers whenever there is an exception in any one of them.

I used javap to find out more about the jdk 1.6.0._17 compiled classes. javap output doesn't have any LineNumberTable which is reason why line numbers are not displayed in the exception stacktrace.

My question: My javac command doesn't use any flags related to debug(like -g:lines,vars,source). So the class file should atleast contain the source & line number information by default. Am not disabling generation of debug info by using -g:none either.

So what could be other reasons for which the LineNumberTable is not getting generated in the .class file?

Any help regarding this is greatly appreciated.

Regards, VK

Vijay
  • 101
  • 2
  • 5
  • Weren't you talking about elsewhere compiled jars? If in their .class file debug info is not compiled that would explain it. Obfuscators should also strip debugging info, like the .class line number table. – Joop Eggen Jun 06 '13 at 08:56
  • BTW as you mentioned JDK classes, maybe you were running with the JRE classes? – Joop Eggen Jun 06 '13 at 08:57

1 Answers1

0

"javap output doesn't have any LineNumberTable which is reason why line numbers are not displayed in the exception stacktrace."

Try:

javap -verbose -l -c JavaApplication2
David Andreoletti
  • 4,485
  • 4
  • 29
  • 51