Scala, JDK 11 and JPMS

Some Google searches seem to indicate that you are very far from being the first person to try to use JavaFX 11 with Scala, and although I’m not expert on the details, there seems to be a fair amount of advice out there about how to do it. For example, have you tried starting the JVM with appropriate --module-path and --add-modules flags, as per java - Make ScalaFx working on both JDK 8 and 11 - Stack Overflow ? Or what about the advice at java - SBT won't compile HelloWorld ScalaFX example, complains about javafx missing from the classpath - Stack Overflow ? )(Those are just a couple of the search results that seemed likely to be relevant; I didn’t sift through them extensively.)

What about GitHub - scalafx/scalafx-hello-world: Simple example of a ScalaFX application , I see that in 2019 you previously received advice to look at that (at Example build.sbt for JDK11 - #11 by Adowrath), how did that pan out? It seems to be regularly updated.

It seems to me that you from the starting point of “the Scala compiler isn’t telling me at compile time that there is a problem”, you are jumping to the conclusion “there is no way forward, I must downgrade to Java 8”. This seems like an enormous jump to me, and I find the conclusion implausible.

Does GitHub - scalafx/scalafx-hello-world: Simple example of a ScalaFX application work for you, or not? The repo readme says it works on JDK 11. If it doesn’t work for you, what error message are you getting?

4 Likes