I've written a super simple java class that is throwing exceptions as it should. However the stack trace I'm getting looks like this:
java.lang.RuntimeException: hello
at Main.go(Unknown Source)
at Main.main(Unknown Source)
Note: there are no line numbers in the stack trace and I would like there to be.
The answers you find when googling this problem are all about adding the correct parameters at compile time to make sure the line numbers actually make it into the class file. However, I don't believe that's my problem as I have this in my ant build.xml
<javac
debug="true"
debuglevel="lines,vars,source"
includeAntRuntime="false"
classpathref="classpath.compile"
srcdir="${src.dir}"
destdir="${build.classes}" />
Also, according to javap, it looks like the line numbers did make it in:
$ javap -l ./build/classes/Main | head -n 9
public class Main extends java.lang.Object{
public Main();
LineNumberTable:
line 14: 0
line 22: 4
line 23: 15
line 24: 26
So what gives? Is there a param I need to set in the jvm when I run the code?
Thanks!