#18925 closed enhancement (fixed)
[WIP PATCH] JavaFX on Java 8
Reported by: | taylor.smock | Owned by: | Don-vip |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | Plugin javafx | Version: | |
Keywords: | java8 | Cc: |
Description
I know that only the "Oracle" java distributions have openjfx on Java 8 (linux distributions do have an openjfx package for Java 8).
I'm working on this since I implemented a date picker in Mapillary, and that requires JavaFX, and I don't want to unnecessarily force people off of Oracle Webstart just yet (see #17858).
Attachments (8)
Change History (26)
by , 4 years ago
Attachment: | 18925.patch added |
---|
comment:1 by , 4 years ago
Keywords: | java8 added; java 8 removed |
---|
comment:2 by , 4 years ago
Please don't throw UnsupportedLookAndFeelException when JavaFX is not here. Just log an error.
follow-up: 4 comment:3 by , 4 years ago
Replying to Don-vip:
Please don't throw UnsupportedLookAndFeelException when JavaFX is not here. Just log an error.
I was trying to figure out the best way to indicate (to the user) that things might not work properly, and that they should either update Java to use OpenJFX 11+, or use Oracle Java, or to install the Linux distribution's openjfx package. I was (mostly) using UnsupportedLookAndFeelException
as a temporary measure.
I think I found a better way (see the next patch), but the verbiage could definitely use a bit of help.
comment:4 by , 4 years ago
Replying to taylor.smock:
I was trying to figure out the best way to indicate (to the user) that things might not work properly, and that they should either update Java to use OpenJFX 11+, or use Oracle Java, or to install the Linux distribution's openjfx package.
If you display a message, please only list the first and last option. I don't want to promote Oracle in any way, after all the mess they created.
follow-up: 6 comment:5 by , 4 years ago
Right now, I'm telling the user "JavaFX is not available" with PluginHandler.confirmDisablePlugin
. I think that is (relatively) clear, but I'm not a standard end user.
If I were to expand the message, maybe something like "JavaFX is not available." + (Platform == "linux" ? "Please install OpenJFX through your package manager." : "Please update to Java 11")
;
comment:6 by , 4 years ago
Replying to taylor.smock:
If I were to expand the message, maybe something like
"JavaFX is not available." + (Platform == "linux" ? "Please install OpenJFX through your package manager." : "Please update to Java 11")
;
Perfect! Technically, "11+"
by , 4 years ago
Attachment: | 18925.2.patch added |
---|
Extend message given to users to indicate how they can fix the issue
by , 4 years ago
Attachment: | 18925.4.patch added |
---|
Completely remove "UnsupportedLookAndFeelException"
comment:7 by , 4 years ago
Not sure to understand the logic here:
boolean isJavaFx = Utils.getSystemProperty("javafx.runtime.version") != null || Arrays.asList("Oracle Corporation").contains(Utils.getSystemProperty("java.vendor"));
If you run Oracle Java 11+, you don't have JavaFX included anymore.
comment:8 by , 4 years ago
I added that since (on my system), Oracle Java 8 doesn't report javafx.runtime.version
. Even though it should. I'll upload a patch that fixes that.
comment:9 by , 4 years ago
Thanks. Final comment (sorry to not have done all of them in a single pass):
String os = Utils.getSystemProperty("os.name").toLowerCase(); if (Arrays.asList("windows", "mac os").contains(os)) {
please rather use
if (PlatformManager.isPlatformWindows() || PlatformManager.isPlatformOsx()) {
follow-up: 11 comment:10 by , 4 years ago
No problem. I thought there was a method somewhere in Utils
, but I didn't see it.
I've been somewhat busy trying to figure out how to get Mapillary to load ~1600 icons without killing JOSM (VisualVM indicated that was the major time sink for loading my experimental Mapillary branch -- like 60s time sink).
This has provided an opportunity for me to think about something else for brief periods of time, which has given me an opportunity to come back to my 1600 icon issue with a different mindset.
comment:11 by , 4 years ago
Replying to taylor.smock:
I've been somewhat busy trying to figure out how to get Mapillary to load ~1600 icons without killing JOSM (VisualVM indicated that was the major time sink for loading my experimental Mapillary branch -- like 60s time sink).
This has provided an opportunity for me to think about something else for brief periods of time, which has given me an opportunity to come back to my 1600 icon issue with a different mindset.
:)
follow-up: 13 comment:12 by , 4 years ago
I guess you also set the plugin.minimum.java.version
in build.xml to 8? Otherwise I don't see how the plugin could work with Java 8, as JOSM would not load the plugin.
EDIT: or simply removed the property.
comment:13 by , 4 years ago
Replying to Don-vip:
I guess you also set the
plugin.minimum.java.version
in build.xml to 8? Otherwise I don't see how the plugin could work with Java 8, as JOSM would not load the plugin.
EDIT: or simply removed the property.
It looks like I just removed the property. I thought I modified the .project file, but it looks like I accidentally added an ivy nature when I shouldn't have (I was avoiding running a standalone svn diff
since I have the differences for #18747 in the same directory).
comment:14 by , 4 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Fixed in [o35371:35373]. I also upgraded to JavaFX 14, as it remains compatible with Java 11.
follow-up: 17 comment:16 by , 4 years ago
You have to worry about the side FX of upgrading...
Sorry, I can't help myself.
On a more serious note, I assume you fixed it with [o35374]. Does that mean that Mapillary/Microsoft Streetside/JavaFX are going to be built (by default) with Java 11, which means they will not work with Java 8?
If so, should I set the source/target for them in the build.xml to 1.8?
The major issue with that approach is that javadocs don't get generated, so the build fails. Its easy enough to "work around" by making the directory its looking for, but I don't believe javadocs are actually generated.
follow-up: 18 comment:17 by , 4 years ago
Replying to taylor.smock:
ODoes that mean that Mapillary/Microsoft Streetside/JavaFX are going to be built (by default) with Java 11, which means they will not work with Java 8?
Built with Java 11, but in 1.8 mode. I looked at the .class files and it seems to be binary compatible with 8. Can you please check?
If so, should I set the source/target for them in the build.xml to 1.8?
It should already be the case, as it is defined in build-common.xml.
The major issue with that approach is that javadocs don't get generated, so the build fails. Its easy enough to "work around" by making the directory its looking for, but I don't believe javadocs are actually generated.
With Java 8 or 11?
comment:18 by , 4 years ago
Replying to Don-vip:
Built with Java 11, but in 1.8 mode. I looked at the .class files and it seems to be binary compatible with 8. Can you please check?
Looks like it -- I built with Java 11, then ran with Java 8.
It should already be the case, as it is defined in build-common.xml.
With <property name="java.lang.version" value="1.8" />
, presumably. I've never seen this before, but it looks like it works. :)
With Java 8 or 11?
Java 11, when I have the following in the build.xml
:
<property name="ant.build.javac.source" value="1.8"/> <property name="ant.build.javac.target" value="1.8"/>
(technically, I can get away with just one, but I do both for clarity).
I think I started using that when I first starting making plugins for JOSM, when I had an issue with the class version being 55 when the JVM supported 52 (I was including ../build-common.xml
at the time, IIRC).
Initial patch