Tuesday, December 13, 2011

Javac debug mode by default

So here is my problem, I am working on a big project and build is organized trough couple of dozens ant scripts. Of course nobody had insight to add debug mode to be configurable on javac tasks so you have to go manually change and add debug="true" attribute.

Not sure if anybody will need this but here it goes, way to default javac to be in debug mode. First go in JAVA_HOME/bin and change javac.exe to javac-old.exe, after that create javac.bat script.

Inside of javac.bat enter following command (this is tested with JDK 1.5_xx).


CALL javac-old -g %* 


What this will do is basically re-route all calls to javac to your "real" javac (in this example javac-old.exe) and pass parameter -g (meaning debug-all mode) and also %* (meaning pass or parameters that you received to next call). Hope it helps somebody.

No comments:

Post a Comment