JavaFX in KNIME 4

It seems that the JavaFX libraries are no longer included in KNIME 4 (tested with today’s nightly build on macOS). This means, the jBrowserDriver plugin for the Selenium Nodes (which requires JavaFX) will break:

E.g. KNIME 3.7.2:

/Contents/Eclipse/plugins/org.knime.binary.jre.macosx.x86_64_1.8.0.152-02/jre/Home/lib/jfxswt.jar

In the 4 nightly, this lib (and further related files) are missing.

Was removing JavaFX intentional or is this an oversight?

– Philipp

1 Like

Certainly not intentional. We switched from Oracle Java to AdoptOpenJDK (details are here).

It seems we (or you) should include one of those?
(Ignorant about the version here – but wanted to get your feedback if that’s an option.)

Hi Bernd,

thanks for the feedback. From my research, these packages are not available for Java 8; the minimum is 11 :frowning: (I checked this option yesterday, as I had a similar issue on our CI environment with OpenJDK)

If that’s true then we are out of luck :frowning: I could do more research but it seems you have done quite some already.
We’ve been considering bumping to Java 11 but then decided not to as Java 8 is well supported and there wasn’t any apparent reason. This may change in the future.

Any other option?

Ok.

According to various tickets (eg. here), there seem to be some more or less brittle solutions to get JavaFX into an OpenJDK (no one’s talking about licensing implications… not sure whether this is a good sign). All in all, this feels like a huge rabbit hole which I’m not willing/able to explore now.

Instead I’ll drop the jBrowser plugin from the upcoming 4.0 release.

Thanks,
Philipp

I think this might cause @swebb a few problems too?

Steve

@s.roughley Thanks! In case there are others who depend on JavaFX I’d be really glad about some feedback and their experience.

1 Like

Ah this wall cause me a major headache I have eclipse views and cell renders that depend on Javafx :worried:

@s.roughley thanks for bringing this to my attention.

@qqilihq I’ll take a look at my internal builds against knime 4 tomorrow and see if I can find a workaround.

I have a docker image with openjdk8 and javafx working so there is some hope :crossed_fingers:

2 Likes

From a quick browse it looks like we may need to build openjfx8 and make an osgi bundle providing the windows, macos and Linux libraries. Both adopt openjdk8 and amazon corretto currently have open issues w.r.t to javafx.

Alternatively a user could swap out the bundled jre for one containing javafx (an older oracle distro or a jre11 with the openjfx libs) but that’s not really a viable solution.

I will investigate further tomorrow.

I looked at that thread too - it looks like they are working back from v11 backwards, but they were aiming for end of Q1 this year for v8, which has obviously slipped significantly… Good luck!

I found that same link. Here’s a solution for Java 8:

It involves a kitchen sink full of build requirements and patching files. And these instructions are only for Windows (so, someone would need to port this and make it work on Linux/macOS as well). And then, all of this would then need to be wrapped in OSGi plugins and fragments :exploding_head:

In my case, the JavaFX dependency is in an additional plugin for the plugin, so I decided to rather strip this out to get a working 4.0 release with 99% of the functionality.

Anyways, I’d still be willing to contribute / cooperate as good as I can to find a common solution.

– Philipp

1 Like

@wiswedel do you think the java 11 update will happen for the next release?

It might be easier for my team internally to not update until either adoptopenjdk resolve the javafx issue or java 11 can be used.

If @qqilihq has a solution he’s happy with then I’m inclined not to go down the rabbit hole of making a javafx bundle and just wait it out.

1 Like

Is there a way here of making sure I’m using the bundled java distribution or do I need to download and configure the AdopteOpenJDK myself?

You have to point it to the JRE of an existing KNIME 4.x installation. The JRE is a feature and part of the update site but it cannot be used when starting from an SDK.

Thanks :slight_smile:

If anyone else stumbles into JavaFX issues in KNIME v4 a solution that appears to be working for me is to switch to use the Amazon Corretto JRE (or an older Oracle JRE) and updating the knime.ini to:

-vm
jre8/bin

My JavaFX Eclipse views, node dialogs and cell renders appear to be working as expected and I’ve not noticed any unexpected behaviour.

Hopefully this can be avoided when Java 11 or newer becomes the embedded JRE.

Cheers

Sam

1 Like

To loop back into an old topic a bit. With the upgrade to Java 11 in KNIME 4.4 it seems to now be possible to add JavaFX as an OSGi dependency and I’ve been able to get my JavaFX integrations working without needing to bundle a custom JRE.

Instructions on adding JavaFX into the dev environment: Add JavaFX controls to a SWT Eclipse 4 application – Eclipse RCP Cookbook UPDATE | vogella blog

:crossed_fingers: it works once installed into a production KNIME

6 Likes

Oh thats super cool :slight_smile:

:crossed_fingers: it works once installed into a production KNIME

False alarm, the AdoptOpenJDK version of the JRE (and probably most others except Bellsoft and Azul) don’t have all the modules required for JavaFX.

So without changing the JRE or using jlink to make my own with the missing module looks like it won’t work.

2 Likes

Pity! But thanks for coming back and clarifying! :slight_smile:

– Philipp