Dependencies on java.desktop

Kevin Rushforth kevin.rushforth at oracle.com
Tue Mar 27 12:26:28 UTC 2018


Hi Tom,

Yes, this is an unfortunate dependency. It is "only" an implementation 
dependency, meaning that nothing in the public API depends on 
java.desktop (which is why we don't "requires transient java.desktop"), 
so it should be possible to remove this dependency in the future. As 
noted, it is only there because Java Beans is part of the java.desktop 
module.

In the interim, your suggestion of "requires static java.base" could be 
the way to go. It would need a spec change to the JavaFX beans adapter 
classes documenting that they would throw an 
UnsupportedOperationException if java.desktop was not present at 
runtime, along with a recommendation that applications needing that 
functionality should add "requires java.desktop" to their own 
module-info.java.

Note that this would only help non-graphical JavaFX applications that 
use javafx.base for its collections, properties, and bindings, since 
javafx.graphics requires java.desktop in a way that currently cannot 
easily be made optional (not without reimplementing printing support 
anyway).

-- Kevin


Tom Schindl wrote:
> Hi,
>
> Anyone else has an opinion on that? Is require static the way to go?
>
> Tom
>
> On 21.03.18 23:23, Tom Schindl wrote:
>   
>> Hi,
>>
>> I always thought the JavaFX-Codebase should be able to run with just the
>> java.base module but I was browsing the codebase a bit and was suprised
>> (or rather shocked) that even the base-module requires java.desktop.
>>
>> If I get it correct this because of the java.beans (provided by the
>> adapters) stuff is found in there. Why hasn't the requires there not
>> defined as:
>>
>> requires static java.desktop;
>>
>> Tom
>>
>>     


More information about the openjfx-dev mailing list