Originally posted by John Meyers:
Yes , your eclipse compiler config should have had the "Generate line number attribute table" option on and if you run it without recompiling with javac you should get the same result. The -g flag in javac will generate all the debugging info and write it into the class files. Either way Its the same line number in my opinion.
I've already had the "Add line numbers to generated class file" checked. If it's not checked, it will give me -1. No, it's not the same line number if I compile it using eclipse and javac. It will be the same though if I dont separate the line.
So what made it different is the compiler. I thought it's the jvm.
Is it possible to make eclipse compiler behave the same way like javac for the line numbers ?