<AWT Dev> xawt/libmawt.so and headless/libmawt.so

David Holmes David.Holmes at oracle.com
Wed Apr 20 04:31:17 PDT 2011


Alan Bateman said the following on 04/20/11 21:01:
> David Holmes wrote:
>>
>> libmawt.so is known to the VM. We use it with Embedded to detect if we 
>> are currently running our headless JRE or not: if xawt/libmawt.so (or 
>> motif21/libxawt.so) isn't present then it is an Embedded headless JRE.
>>
>> So any change here would have to be coordinated with a VM change.
>>
>> Glad I was subscribing to this list :)
> I'm glad too. Do you think this could be done a different way? In 
> java.awt.GraphicsEnvironment I see that isHeadless consults 
> getHeadlessProperty to determine if we are headless and one of the 
> things it checks is whether the DISPLAY variable is set. If this 
> additionally checked that libxawt.so is available then would it avoid 
> needing code in the VM?

It's a different definition of "headless". The JDK can have headful 
capabilities but operate in headless-mode - all the libs are still 
present. The SE-Embedded headless JRE has had all the headful libs 
stripped out. We use the absence of the libs to recognize that this is a 
headless-JRE and use that to set the java.awt.headless property so that 
the Java libs act in headless-mode. So the VM drives this.

David



More information about the awt-dev mailing list