Where do you configure Eclipse Java compiler (javac) flags?

狂风中的少年 提交于 2019-12-17 12:15:10

问题


Ex.

javac -g ButtMonkey.java

Where do you configure the -g flag when Eclipse compiles Java source? (Using Ganymede but I doubt that has changed in later versions so any answer probably helps.)

What I need is:

-g

Generate all debugging information, including local variables. By default, only line number and source file information is generated.


回答1:


Select the menu: Window > Preferences > Java > Compiler

There you will find several check boxes under the heading "Classfile Generation".




回答2:


For Eclipse version Photon Release (4.8.0)(Build id: 20180619-1200), Enabling (or disabling) the debug flag in Eclipse IDE,

  1. Window > Preferences > (left option) Java > Compiler
  2. (section) 'Classfile Generation'
  3. (checkbox) 'Add variable attributes to generated class files (used by the debugger)' // Checking this checkbox will enabled the debug flag. Unchecking this checkbox will disable it.

From, Sharma, J; Sarin, Ashish. Getting started with Spring Framework: Third Edition (Kindle Locations 2500-2508). UNKNOWN. Kindle Edition.



来源:https://stackoverflow.com/questions/9483315/where-do-you-configure-eclipse-java-compiler-javac-flags

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!