JB JDK 11 with JavaFX Platform.runLater doesn't run on fx application thread

I am currently trying to implement a first PoC for a plugin using the JavaFX WebView. I am trying to run this code on the newest JB JDK 11, because I need to use at least the OpenJFX 11 release. However, as soon as I try to execute something on the main JavaFX thread using Platform.runLater(...) (in this case, I'm initializing the WebView and the engine), I still get the following exception:

java.lang.IllegalStateException: Not on FX application thread; currentThread = JavaFX Application Thread

I am creating a new JFXPanel right before the call, so the toolkit is already initialized and calls to Platform.runLater() should run on the regular fx thread, right? I have no issues with the same code on the JB JDK 8 with OpenJFX 8.

Comment actions Permalink

JBR11 includes JFX10 (that is not obvious, but the fact). Still it's not clear why you encounter the issue. Could you please provided a minimal code that reproduces it?

Comment actions Permalink

So my laptop broke down one day after I wrote this post. I am now using an alternative machine and had to set up everything again. This time, I didn't use the Toolbox and downloaded all IDEs directly from JetBrains. I am now using the latest JBR11 (both for the IDE itself and the as the project SDK) and everything works as expected, without any bugs. I will try to reproduce the error in the following days (maybe using an old JB JDK?), but so far I couldn't manage to get the same error as on my broken laptop.

Thanks for the info about JFX10, I didn't know which version was included with the current JBR. I already tried using the JBR11 on my old machine, but got the same error as mentioned above. Although I have to say, it was not the JBR that I am using now, which is the latest one.

I will update this post as soon as I have any new information on the topic and can reproduce the exception. Thanks for the help.


Please sign in to leave a comment.