Monday, December 20, 2004

Ant default debug level

The javac compiler generates the line numbers while compiling so that in case of an exception the stack trace can tell what line number the error happened.




So I know I should look at line 7 of and .

However if I say "javac –g:none" while compiling then I will not get the above line numbers. Not so helpful, right ?

But that is what ant defaults to. Look at this doc:

“Debug: Indicates whether source should be compiled with debug information; defaults to off. If set to off, -g:none will be passed on the command line for compilers that support it (for other compilers, no command line argument will be used). If set to true, the value of the debuglevel attribute determines the command line argument.”

Maybe there is solid reason for this, but it sure beats me if there is one!


Post a Comment

<< Home