How to add debugging information when compiling using the Java Compiler API

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

I think this has something to do with the getTask() -method options parameter, but I cannot find references to the correctness of this assumption, and if so, what is the correct way to control this?

+4
source share
2 answers

Perhaps you can continue your search in the "arguments" argument to the getTask () method, which allows you to pass parameters to the compiler; in your case it will be some option -g: none, as described in http://java.sun.com/javase/6/docs/technotes/tools/windows/javac.html#options

+1
source

Check out http://www.javabeat.net/articles/73-the-java-60-compiler-api-1.html In the JavaCompiler class there is a field for passing in the -g parameters - this is information for debugging.

+2
source

Source: https://habr.com/ru/post/1306957/


All Articles