Java compilation and -g

Erik Joelsson erik.joelsson at
Mon Apr 14 08:41:05 UTC 2014

Interesting question. I did a comparison of the total size of the images 
on my Linux x64 workstation:

       current no-g  all-g
j2sdk 303M    300M  314M
j2re  212M    209M  220M

I should clarify that in langtools, -g is only added to the compilation 
of the interim compiler, not the classes that get included in the actual 
product (tools.jar).


On 2014-04-11 19:47, Gary Adams wrote:
> What is the size difference?
> On 4/11/14, 10:53 AM, Chris Hegarty wrote:
>> On 11/04/14 15:40, Erik Joelsson wrote:
>>> Hello,
>>> While converting the build to the new build-infra makefiles, one thing
>>> that annoyed me was the fact that we aren't consistently compiling with
>>> or without -g for java code. In the new makefiles we just emulate the
>>> same behavior, but I would like to sort it out properly now.
>>> Currently langtools, jaxp and jaxws repos build with -g always, while
>>> corba and jdk only build with -g when DEBUG_LEVEL is fastdebug or
>>> slowdebug.
>>> How would we really like this to work? Is there a reason not to ship
>>> with -g enabled? I know from personal experience that I get very 
>>> annoyed
>>> when I can't step into the jdk classes and look at local variable 
>>> values
>>> when debugging my own java applications.
>> +1.
>> I can understand that this may be different for actual product builds.
>> -Chris.
>>> /Erik

More information about the build-dev mailing list