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

2

25

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.

Douville answered 28/2, 2012 at 14:2 Comment(2)
+1 for ButtMonkeyPharyngoscope
Was hoping someone would get a kick out of that. lolDouville
S
22

Select the menu: Window > Preferences > Java > Compiler

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

Sporogony answered 28/2, 2012 at 14:6 Comment(2)
Oh sneaky, they hide the actual flags from you. Was afraid I was going to have to create a custom builder!Douville
@Douville Note that Eclipse uses its own built-in Java compiler (which is not exactly the same as javac from the JDK), so there isn't one checkbox which exactly matches what -g on javac does.Sporogony
H
0

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.

Hearse answered 20/9, 2019 at 2:4 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.