Example build.sbt for JDK11

Can someone, please, provide a working build.sbt that works with JDK 11 and targets JDK 11? Might be with Scala 2.13.

for “works with JDK 11”, you don’t need to do anything special (except be using the latest patch release of whatever sbt version you’re on. currently that means 0.13.18, 1.2.8, or, if you’re brave, 1.3.0-RC1)

not sure what you mean by “targets JDK 11”. to target both JDK 8 and 11, you don’t need to do anything special.

do you have an existing build.sbt that isn’t working? if so, what are the symptoms?

I want to use OpenJFX 11. Therefore I need to add a module-info.java otherwise it won’t work. But as soon as there is a “module-info.java” in a Java source folder the compilation fails.

Try this: https://github.com/ysden123/akka-stream/blob/master/akka-stream-scala/build.sbt

Does it indeed not work for you? I’ve done a few JavaFX projects with OpenJFX 11 and 12 in the past year as part of my Uni homework, and never had to add a module-info.java to make them work.

Yes, it does not work for me. Do you have a simple example project for me?

Here you are my friend ->

This works with Scala 2.12 and JavaFX 11 !!

NOTE: Please ensure you have Java JDK 11 installed and configured with the proper JAVA_HOME and PATH

1 Like

Thank you so much! This works for me. But what does ScalaFX in order to avoid the Jigsaw problems?

I ask because if I try to create an example project WITHOUT ScalaFX I get always that “cannot access” problem with modules.

1 Like

Good question !! … but since ScalaFX is a solid project I think it’s OK to based real application on it and let several man hours to help you on this.

For sure in the future with more experience … and more status quo stablishment of the libraries it will be easier to discover and reproduce it on clean vanilla project.

Let us know how your ScalaFX projects go … Enjoy !! :slight_smile: :slight_smile:

I am happy to use libraries but before I do so I need to understand what is happening under the hood. In that case nobody yet could tell me what ScalaFX does differently.

Plus: Since ScalaFX defines its own wrapper classes for JavaFX classes I am afraid I cannot use Scene Builder together with ScalaFX.

1 Like

I just wanted to say that, you can!, but as it stands, I can not verify if this works for current JavaFX versions. It used to for an old project I ran on Java 8, so you might want to give it a look:
https://vigoo.github.io/posts/2014-01-12-scalafx-with-fxml.html

1 Like