Open xzel23 opened 5 years ago
Great start. I will wait with merging until it works with J11, OK?
Ok, works now (still getting java.lang.IllegalArgumentException: Unable to retrieve embedded or remote manifest.
).
On Java 11, using jaxb pulls in a lot of dependencies that are required on the runtime classpath. I think XML should either be required by JSON or the code rewritten to use org.w3c
instead which is stiill part of the JDK.
That's bout what I can do for now. I think next problem will be the one remaining use of internal API. But I can only continue there once the "Unable to retrieve embedded or remote manifest" issue is solved.
More detail on what I did and how to run on Java 11 (did not try on Java 9 and 10 because I don't have them installed and both have already reached EOL):
problem 1 was that in Java 11 main()
inside a class extending Application
is not called. So I moved main()
to a new class Main
and updated the POM accordingly.
next ist that you have to have the dependencies on the classpath.
To run in Java 8:
java -jar ./fxlauncher.jar
To run in Java 11:
OK, I found out why the manifest could not be loaded. I did not use the --app
parameter. Now that I do, an NPE is thrown later on.
I think I learned enough about FxLauncher to fix the remaining problems. I will let you know when everything works and this is ready and working in both Java 8 and 11. Please wait with merging.
After I have looked deeper into this, this is where we are now:
--add-open
switches on Java 11+.How to run fxldemo in Java 11 (change paths accordingly):
java --module-path=/Users/axel/Development/libs/javafx-sdk-11.0.2/lib \
--add-modules=javafx.controls,javafx.web,javafx.fxml,javafx.base \
--add-opens=javafx.graphics/com.sun.javafx.application=ALL-UNNAMED
--add-opens=javafx.base/com.sun.javafx.runtime=ALL-UNNAMED
--class-path=./fxlauncher.jar:../../lib/jaxb-api-2.3.0.jar:../../lib/jaxb-api-2.3.0.jar:../../lib/jaxb-core-2.3.0.jar::../../lib/jaxb-impl-2.3.0.jar:../../lib/activation-1.1.1.jar fxlauncher.Launcher \
--app=app.xml
Hi! Thanks for the great work, but since this thread has not been updated in a while I need to ask: is anyone still working on this? Is this ever going to be merged in FXLauncher?
Thanks again (:
I don't have time to work on this at the moment. Eventually I'll update it when I need to use JDK13+ myself, but in the mean time anyone is free to contribute :)
This adds the java.xml.bind dependency for Java 9+ and also JavaFX for JDK 11+. I can now compile FXLauncher under both JDK 8 and 11. The resulting jar should work as before on Java 8. I cannot test Java 9 and 10, but to actually run on Java 11, more tweaks are needed.
I tried to test this with the fxldemo project, and both jars (= compiled with JDK 8 vs JDK 11) work the same when run under JDK 8. I get an error "WARNING: Error during Update Manifest phase" when I replace the original fxlauncher.jar with the new SNAPSHOT version though. But I see the same error when replaing with the original SNAPSHOT version (not containing my changes), so this seems unrelated.
When running on JDK 11, I get this error:
I will look into the issue with running under Java 11 later.