开发者

How to add debug information when compiling with Java's Compiler API

开发者 https://www.devze.com 2022-12-26 16:25 出处:网络
What do I need to do to control whether my classes compiled with a JavaCompiler will include debug information or not?

What do I need to do to control whether my classes compiled with a JavaCompiler will include debug information or not?

I'm thinking it has something to do with the getTask()-method's options parameter, but I can't find any references on whether that assumption is correct to start with, and if so, what is the correct way to control t开发者_运维技巧hat?


Check out http://www.javabeat.net/articles/73-the-java-60-compiler-api-1.html In JavaCompiler class there is a field to pass in the options -g is the one for debug information.


Maybe you could search further in the "options" argument of the getTask() method, which allows to pass options to the compiler; in your case it would be some "-g:none" option as detailed in http://java.sun.com/javase/6/docs/technotes/tools/windows/javac.html#options

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号