[9] Review request for 8157002: Toggle gtk version if SWT used via FXCanvas

Semyon Sadetsky semyon.sadetsky at oracle.com
Wed Nov 23 12:32:41 UTC 2016

On 11/23/2016 12:38 PM, Tom Schindl wrote:

>  From looking at the code I doubt your fix will work reliably in a
> OSGi-Environment who is the Main deployment scenario for SWT and hence
> FXCanvas!
> For sure you won't find the SWT-Library on the SystemClassloader and
> whether you find it on the Thread-ContextClassloader is just gambling!
> The only area you for sure can detect the swt-library are the
> swt-fx.jar-Classes because those are guaranteed to be loaded with a
> classloader who can look up SWT-Libary classes like
> "org.eclipse.swt.internal.gtk.OS"
What is swt-fx.jar? Maybe you meant javafx-swt.jar?
> BTW: Is the statement below really correct?
> .... in JFX embeded into SWT scenarios JFX loads GTK primarily ...
> If you create an instance of FXCanvas SWT must have been loaded already
> (You need to pass a parent Composite) so the native gtk-libs are there
> already loaded.
That's right concern. Actually the fix covers the scenario when swt.jar 
is on the classpath and may be potentially loaded in future with another 
GTK version (which will cause the process crash). The rest scenarios are 
covered by the 8156491 fix which I just posted for review.

> Tom
> On 22.11.16 14:51, Semyon Sadetsky wrote:
>> Hello Kevin & David,
>> Please review the fix for jfx9:
>> bug: https://bugs.openjdk.java.net/browse/JDK-8157002
>> webrev: http://cr.openjdk.java.net/~ssadetsky/8157002/webrev.00/
>> In JFX embeded into SWT scenarios JFX loads GTK primarily. So SWT GTK
>> version cannot be detected using the check for the loaded native library
>> version.
>> The fix proposes a way to detect if GTK version of swt.jar library is
>> available on the classpath and tries to get the GTK version from SWT lib
>> internal java classes.
>> --Semyon

More information about the openjfx-dev mailing list