Page 1 of 1

How to deploy a JavaFx-based plugin into Oxygen 24

Posted: Wed Jun 01, 2022 4:37 pm
by Vince
Hi,

I have a custom plugin.
This Java-based plugin embed an internal browser window using JavaFX components.

And with latest oxygen 24 version I note this error :
cannot access class com.sun.javafx.webkit.WebConsoleListener (in module javafx.web) because module javafx.web does not export com.sun.javafx.webkit to unnamed module @0x27bf574b
To solve it, I know that I can add VM option

Code: Select all

--add-exports javafx.web/com.sun.javafx.webkit=UNNAMED
Is there an alternative to this ? maybe a custom packaging of my plugin so that I do not need to change VM options to all end user Oxygen desktop application.

Note that with OXygen 23, we don't have this problem.

Yet another question.
Adding this option to oxygen.bat solve my problem in case of running oxygen from bat
Adding option to custom_commons.vmoptions or custom_oxygen.vmoptions has no effect running oxygen from exe.
Why this behaviour ?

Thx

Re: How to deploy a JavaFx-based plugin into Oxygen 24

Posted: Thu Jun 02, 2022 6:38 am
by Radu
Hi,

In the Oxygen downloads page besides the default download kit (bundled with Java 17) we have further down in the page an Windows 64-bit (Includes Java SE 8u202):
https://www.oxygenxml.com/xml_editor/do ... os=Windows
This kit bundled with Java 8 does not have any limitations as these particular module limitations were added in Java 9 and newer.
So as an alternative you could use this Oxygen kit bundled with Java 8. I think in the past (older Oxygen versions) the Oxygen + Java 8 kit was the default one and the Oxygen + Java 15/17 was the optional kit found further down in the downloads page.
But it's possible that in Oxygen 25 (September 2022) we'll remove completely the Oxygen + Java 8 kit.
In the meantime I also added an internal issue to maybe add by default in our startup this extra --add-exports.
About not being able to set the extra export in the "custom_common.vmoptions", we'll look into this, how about if you make changes directly to the "oxygen24.1.vmoptions" just to see if that works or not?

Regards,
Radu

Re: How to deploy a JavaFx-based plugin into Oxygen 24

Posted: Mon Jun 06, 2022 10:09 pm
by Vince
Hello,

Thanks a lot for your help.

We cant roll back our plugin to Java 8. Java 17 is our target.
Until now, we used the bundle Java 15 of Oxygen 23, and we don(t need to add the extra --add-exports.
I suspect that something has changed with your bundle.

To answer you about adding option directly to the "oxygen24.1.vmoptions", no, no changes. It seems that the option is not taken into account.

I managed to bypass the behaviour building a fat jar, a jar with all modules I need (javafx.web, javafx.swing) for all targeted platform (mac, windows, linux).
And it works without adding any extra option.

Regards,
Vince

Re: How to deploy a JavaFx-based plugin into Oxygen 24

Posted: Tue Jun 07, 2022 6:02 am
by Radu
Hi Vince,

Your code seems to use the "com.sun.javafx.webkit.WebConsoleListener" class which is non API.
This kind of checks that a module cannot be used from outside cannot and are not done in our code. I suspect between Java 15 and 17 there were additional modules added to these checks.

Regards,
Radu