DEV Community

Bruce Axtens
Bruce Axtens

Posted on • Updated on

Need help setting up Java 13 with JavaFX

Over on the B4J site they encourage the use of Java 11 and have a zip file containing a full Java 11 with JavaFX zip available.

I'd like to use Java 13. I've tried to create a Java 13 folder structure like their Java 11 one, with javafx in the root, viz

>dir jdk-11.0.1 /b
bin
conf
include
javafx
jmods
legal
lib
release
Enter fullscreen mode Exit fullscreen mode

However in their javafx folder there's a javafx-jmods folder with some *.jmod files in it, viz

javafx.base.jmod
javafx.controls.jmod
javafx.fxml.jmod
javafx.graphics.jmod
javafx.media.jmod
javafx.swing.jmod
javafx.web.jmod
Enter fullscreen mode Exit fullscreen mode

My downloaded-from-Oracle javafx didn't include a javafx-jmods folder and no *.jmod files. How are these generated?

All clues gratefully received.

LATER

jmods are here. Didn't see them there last time.

LATER AGAIN

Okay, over that hurdle. Still running. Still getting the following out of B4J:

B4J Version: 8.00
Java Version: 8
Parsing code.    (0.00s)
Building folders structure.    (0.01s)
Compiling code.    (0.05s)
Compiling layouts code.    (0.00s)
Organizing libraries.    (0.00s)
Compiling generated Java code.    Error
src\b4j\example\main.java:7: error: package javafx.application does not exist
public class main extends javafx.application.Application{
                                            ^
1 error
only showing the first 1 errors, of 6 total; use -Xmaxerrs if you would like to see more

javac 13.0.1
Enter fullscreen mode Exit fullscreen mode

LATER SAME DAY

I've written into the forum for B4J the following

@Erel where do I specify the -Xmaxerrs setting? I want to see more errors. I'm referring to the window that says, "showing the first 1 errors, of 6 total; use -Xmaxerrs if you would like to see more"

Also, if I wanted to emit some java into the output stream, is there a mechanism to do so? Currently I'm wondering if I need to embed an explicit import statement into Objects\src\b4j\example\main.java

I've duplicated the directory structure as much as possible between v11 and v13. Still nothing.

I've put a zip of the Java 13 + JavaFX folder into my Dropbox, just in case anyone wants to compare it with a Java 11 install and tell me what I missed.

FINALLY

B4J does not support Java 13. It only supports Java 11. Java 11 is a Long-Term Support version. Java 13 isn't. You can use Java 13 but not with JavaFX. If you want JavaFX, the only route is with Java 11.

Top comments (5)

Collapse
 
bdunkleysmith profile image
bdunkleysmith • Edited

Hi Bruce,

I have downloaded your Java 13 folder and get the same error when trying to run a project.

But I note the second line says "Java Version: 8" when I thought that should say 13.

I've not compared your structure to the Java 11 one, but will do so.

Collapse
 
bugmagnet profile image
Bruce Axtens

I have reported the Java Version issue to Erel. The fact that B4J believes the java version to be 8 suggests that B4J isn't handling the 13-ness of javac.exe very well. When one points the IDE at Java 11, the Java Version says, "11".

Collapse
 
cchacin profile image
Carlos Chacin ☕👽

Hi Bruce, this is a repo where I use mqvenplugins in order to generate a final image containing the jdk + javafx mods: github.com/cchacin/javafx-todoapp

Take a look to see if that can guide you.

Collapse
 
bugmagnet profile image
Bruce Axtens

Thanks, have cloned the repo. Hoping for some clues.

Collapse
 
bdunkleysmith profile image
bdunkleysmith

Hi Bruce, I've followed you over from the B4J Forum and I see you're making progress. Unfortunately I can't provide any insight into the cause of the error thrown, but I hope others can.