Opened 4 years ago
Closed 4 years ago
#19242 closed defect (invalid)
Should the javafx plugin set `Plugin-Minimum-Java-Version: 11`?
Reported by: | floscher | Owned by: | Don-vip |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | Plugin javafx | Version: | |
Keywords: | Cc: | Don-Vip, taylor.smock |
Description
In https://gitlab.com/JOSM/plugin/Mapillary/-/jobs/554036112#L120 the build of the Mapillary plugin with Java 8 fails, because the javafx-unixoid
plugin has a too high class file version:
class file has wrong version 55.0, should be 53.0
I'm not really familiar with OpenJFX and Java 8/11 compatibility, so would adding Plugin-Minimum-Java-Version: 11
solve the issue, or should the javafx
plugin be compiled with Java 8 compatibility, or something else?
Attachments (0)
Change History (4)
follow-up: 2 comment:1 by , 4 years ago
follow-up: 3 comment:2 by , 4 years ago
Replying to taylor.smock:
The problem is that the
javafx
plugin is using a pre-compiled binary for JavaFX 11 (which, AFAIK, supports Java 11+).
Ok, so the javafx
plugin should set Plugin-Minimum-Java-Version: 11
, right? Then this should go away.
However, if one of the following is true, it still works on Java 8:
- Oracle is the java vendor (so JavaFX is built in)
- The user is on Linux and has installed the
openjfx
packagesWhen I get in to the office, I'll correct the gradle checksum in my branch (oops) and make the following change:
registry.gitlab.com/josm/docker-library/openjdk-8-josmplugin-openjfx:latest
to
registry.gitlab.com/gokaart/docker-library/openjdk-8-josmplugin-openjfx:latest
.
And then run the CI/CD pipeline.
I know you are trying to do some magic in the gradle plugin for JavaFX, but it was compiling OK under v0.6.5 of the gradle plugin, and I think I was using the
gokaart
version of the container (thejosm
version had been failing for me, even after you made some modifications).
The "magic" was previously done in the buildscript of the Mapillary
plugin (removed in 21b3c29), I just put it into the gradle-josm-plugin
, so other plugins can use the same.
Still, the Mapillary plugin would probably not compile on Java 8. It relies on classes from the javafx
plugin (e.g. DatePickerFx), which would not be there on JDK8, because the javafx
plugin is Java 11+ only.
comment:3 by , 4 years ago
Replying to floscher:
Still, the Mapillary plugin would probably not compile on Java 8. It relies on classes from the
javafx
plugin (e.g. DatePickerFx), which would not be there on JDK8, because thejavafx
plugin is Java 11+ only.
It isn't truly Java 11+ only. It works on Oracle Java 8 and Java 8 on Linux if the openjfx
package is installed. (See https://gitlab.com/JOSM/plugin/Mapillary/pipelines/146439682 for a run with the alternate openjfx image).
I did put some logic in the JavaFX plugin to check if javafx could work, and if not, give the user a message and offer to disable the plugin.
boolean isJavaFx = Utils.getSystemProperty("javafx.runtime.version") != null || ("Oracle Corporation".equals(Utils.getSystemProperty("java.vendor")) && Utils.getJavaVersion() < 11); if (!isJavaFx && Utils.getJavaVersion() >= 10) { extractNativeLibs(ext); loadNativeLibs(ext, orderedNativeLibraries); } else if (!isJavaFx) { Logging.error("JavaFX is not available"); StringBuilder message = new StringBuilder(tr("JavaFX is not available.")); PlatformManager.getPlatform(); if (PlatformManager.isPlatformUnixoid()) { message.append(tr(" Please install OpenJFX through your package manager.")); } else { message.append(tr(" Please update to Java 11+.")); } if (PluginHandler.confirmDisablePlugin(MainApplication.getMainFrame(), message.toString(), info.getName())) { PluginHandler.removePlugins(Collections.singletonList(info)); } return; }
comment:4 by , 4 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
Thanks for the explanation! I think I'll just close this now, since it seems on the javafx
plugin side everything is handled correctly regarding Java 8 compatibility.
The problem is that the
javafx
plugin is using a pre-compiled binary for JavaFX 11 (which, AFAIK, supports Java 11+).However, if one of the following is true, it still works on Java 8:
openjfx
packagesWhen I get in to the office, I'll correct the gradle checksum in my branch (oops) and make the following change:
registry.gitlab.com/josm/docker-library/openjdk-8-josmplugin-openjfx:latest
toregistry.gitlab.com/gokaart/docker-library/openjdk-8-josmplugin-openjfx:latest
.And then run the CI/CD pipeline.
I know you are trying to do some magic in the gradle plugin for JavaFX, but it was compiling OK under v0.6.5 of the gradle plugin, and I think I was using the
gokaart
version of the container (thejosm
version had been failing for me, even after you made some modifications).