问题
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,
- Window > Preferences > (left option) Java > Compiler
- (section) 'Classfile Generation'
- (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