Stream: committers
Topic: JavaFX not bundled in JRE anymore
Jean Duteau (Mar 25 2019 at 06:03):
There was a thread back in October 2018 about the javafx jar file not being found. I just wanted to point out that although it was included in standard JREs from 8 to 10, it will no longer be bundled with the JRE for java 11. I just found this out because I had to upgrade to Java 11 for another project and my FHIR build won't run anymore (until I solve this problem).
Grahame Grieve (Mar 25 2019 at 07:31):
hmm. @James Agnew what should we do about this? Should I try and find some other not using JFX?
Grahame Grieve (Mar 25 2019 at 07:32):
I use it for rendering html.
David Pyke (Mar 25 2019 at 11:57):
I had to stick with Java 8 to keep the build working and use the java-8 JavaFX libraries (and fight ubuntu for them).
James Agnew (Mar 25 2019 at 13:21):
Hmm interesting- As of Java 11 a bunch of stuff that used to be bundled into the JDK are now separate JARs. Lemme see if there is an obvious fix.
James Agnew (Mar 25 2019 at 14:36):
Ok- I've got a version of this building cleanly and seemingly running fine on Java 11, but I had to move it over to org.hl7.fhir.core so I could use Maven to build it.
It seems that JavaFX is kind of annoying to get working on JDK11 because the JARs are not cross-platform (first time I've ever seen such a thing in Java... sigh).
My testing though seems to show this working fine on Mac though so that's a good start. @Jean Duteau @David Pyke would you guys be willing to checkout the following branch, build it, and try the igtools JAR that gets built? https://github.com/hapifhir/org.hl7.fhir.core/tree/ja_add_igtools
James Agnew (Mar 25 2019 at 14:53):
(Oh and BTW I'm specifically hoping for testing on JDK 11)
Jean Duteau (Mar 25 2019 at 15:36):
@James Agnew i checked it out and built the jar files and then used the following command:
java -jar org.hl7.fhir.core/org.hl7.fhir.igtools/target/org.hl7.fhir.igtools-3.7.18-SNAPSHOT-jar-with-dependencies.jar -ig ig.json
and received the following error:
Caused by: java.lang.ClassNotFoundException: org.apache.http.client.methods.HttpUriRequest
So there might be a missing dependency jar?
James Agnew (Mar 25 2019 at 18:20):
@Jean Duteau - Thanks, ok, I've added that dependency to the branch. Do you mind to try again?
Grahame Grieve (Mar 25 2019 at 18:49):
I had to move it over to org.hl7.fhir.core so I could use Maven to build it.
Grahame Grieve (Mar 25 2019 at 18:49):
why?
Grahame Grieve (Mar 25 2019 at 18:49):
btw, when we move the igtools to maven (soon), it will have to be in a different github project
James Agnew (Mar 25 2019 at 18:53):
The JavaFX jars are published by Maven and they use a "classifier" to distinguish between the various OS-specific versions of the JAR. It seems like Ivy doesn't understand classifiers- I couldn't get it to even fetch any versions of those JARs.
Basically, most dependencies have a group and an artifact ID as their two identifiers. Things with a classifier have a third identifier describing the context of use.
Once this works within org.hl7.fhir.core as a Maven module, I guess it should be pretty trivial to move it elsewhere if you want to..
Grahame Grieve (Mar 25 2019 at 18:58):
ok. do we have to use javafx to displaya web page? is there a better way?
James Agnew (Mar 25 2019 at 19:12):
This isn't an area I've spent much time with TBH... But a long time ago I remember doing something like this: https://alvinalexander.com/blog/post/jfc-swing/how-create-simple-swing-html-viewer-browser-java
IIRC it's not a great browser though, support for some more modern web things isn't good. Possibly it's good enough for this purpose though.
Grahame Grieve (Mar 25 2019 at 19:47):
might no be - it displays the full IG
Grahame Grieve (Mar 25 2019 at 19:47):
is it really that hard in Java? unbelievable....
Jean Duteau (Mar 25 2019 at 20:06):
I got it working by adding the following dependencies:
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
</dependency>
<dependency>
<groupId>com.atlassian.commonmark</groupId>
<artifactId>commonmark</artifactId>
<version>0.12.1</version>
</dependency>
<dependency>
<groupId>com.atlassian.commonmark</groupId>
<artifactId>commonmark-ext-gfm-tables</artifactId>
<version>0.12.1</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>4.0.1</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>4.0.1</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>ooxml-schemas</artifactId>
<version>1.4</version>
</dependency>
Grahame Grieve (Mar 25 2019 at 20:07):
I guess a different question would be if anyone would care if the gui part didn't show the outcomes in the UI and it would launch a browser instead
Jean Duteau (Mar 25 2019 at 20:08):
the httpclient was the one you added and the two commonmark and the three poi ones. I haven't pushed that to the branch because I wanted to double-check that we wanted these included in the jar dependency jar.
Jean Duteau (Mar 25 2019 at 20:16):
Let me know if you want me to push my changes to make it work
James Agnew (Mar 26 2019 at 18:57):
"is it really that hard in Java? unbelievable...."
Well, I mean most languages don't include a native cross-platform web browser and Java has 2 of them.. they just aren't trivial to set up :)
@Jean Duteau yes please
Grahame Grieve (Mar 26 2019 at 19:59):
I think that it's better to remove JavaFX
Grahame Grieve (Mar 26 2019 at 19:59):
and remove the functionality
Grahame Grieve (Mar 26 2019 at 21:24):
ok so I removed the functionality but the layout sucks. It was already bad but no it's worse. And Swing gave me a headache quickly. what a mess... Does someone who can tolerate swing want to clean up the layout?
James Agnew (Mar 26 2019 at 21:42):
What's the rationale for not just using the JavaFX version? It was annoying to get that working.. but it's working now
Grahame Grieve (Mar 26 2019 at 21:54):
because it's been an ongoing problem in that it takes expertise to get the igublisher to run
Grahame Grieve (Mar 26 2019 at 21:55):
and the yield was low
Grahame Grieve (Mar 26 2019 at 21:55):
(e.g. the functionality using JavaFX wasn't that inportant)
James Agnew (Mar 26 2019 at 22:16):
got it
Patrick Werner (Jul 30 2019 at 14:31):
where does FHIR use JavaFX (which is basically dead like all non-web based Java frontends)?
Grahame Grieve (Jul 30 2019 at 19:18):
the IG publisher UI used to to host a browser. not any more.
Last updated: Apr 12 2022 at 19:14 UTC