Off topic, but I just have to ask if anyone has sp...
# tornadofx
j
Off topic, but I just have to ask if anyone has spent any serious time trying to use JavaFX with Java 11? Not with Kotlin, just "plain" Java 11... It is really amazing how difficult it is now. It could just be me, but all of the stuff that was so "simple/easy" with Java 8 seems really complex with regard to setting up the dev env... I hope it's just me. All of the "add-exports" seem strange...
a
We've discussed it several days ago, I'm able to run JavaFX11/Kotlin project with pure Oracle JDK, no add-exports needed
I've spend some time reading all these tutorials as well, to avoid export thing you need to provide
module-info.java
, which solves basically everything
a
add-exports
is typically only required if you need to access something from the internal API.
j
Have you tried using any external libraries with it? PreferencesFX or anything like that? Plain works fine... when I try to use any "recent" JavaFX libraries it seems like it's back to adding all of the "--add-exports"...
I spent about a month working with JPMS I kept running into issues with external libraries. Which I realize I don't have to use. It's really a pia compared to what it used to be...
I can't wait to show my team members how easy it is to work with Java 11 and JavaFX 🙂
a
I have issues with some libraries, like arrow-kt, others are working fine.
https://github.com/sanyarnd/kani you can look at my `pom.xml`/`module-info.java` here, this project works on Windows machine with pure Oracle JDK, nothing else.
j
Sound goods, I think I'll just accept that I need to spend more time studying up on what the changes have taken place. I'm sure it will pay off in the long run 🙂
a
Does
PreferencesFX
11 use internal API as well?
I thought ControlsFX was the only library heavily dependent on internal APIs 😵
j
Checking on it now. Stuck on most recent "error" of
javafx.scene.control.TreeItem.children accessible: module javafx.controls does not "opens javafx.scene.control" to unnamed module
I'm sure it's my error, it's just frustrating how involved it seems it has become.
a
The issue is
module-info.java
, you need to add something like this:
Copy code
opens your.package to javafx.controls, javafx.graphics, javafx.fxml;
if I recall correctly
j
You are correct. Plain Java/JavaFX 11 works fine. My problem is with external libraries and their dependencies. Not really a Java problem I admit.
a
There's nothing you can do, I'm afraid. The only way is to use jvm/compiler flags 😞. Almost a year since Java11 (and 5? since Jigsaw thing), yet many libraries are not ready for good Java11 experience
m
yes you need to declare what internal packages you're "breaking in to" as they see it, now. it's a bit a pita but it's a mechanical process of setting the flags
you can just --add-exports or --add-opens until the libraries or jdk are fixed