~adj/comment-test-tracker#148: 
Java 11 Breaks The Program (lack of JavaFX)

I heard about Java 11 dropping JavaFX last month, which was concerning, but now that I try things out with the preview build, it's even worse than expected. Since the first thing the editor does is ask the user to select their Civilization install directory, and it initializes a JavaFX FileChooser as part of that setup, it displays the (Swing) "Please select the install directory" notice, and then promptly crashes.

It is essentially as bad for existing installations. While the main UI loads up in that case, nothing scenario-related works (quite literally). This is due to the background UI loader initializing JavaFX, which fails, and which causes subsequent steps in the initialization (including of Swing components) to fail. Thus, even if you load a file via shortcuts (not the JavaFX open dialogs), they will fail to load due to uninitialized Swing components. Only the main splash screen, Preferences dialog, new-version-alert system, and About menu item work as expected.

Of the options:

  • Building platform-specific builds is not realistic due to lack of a Mac, and increased time required. Neither the monetary cost nor time is really justified on a side project. Although an updated Windows XP build, including Java 8, could serve as a stopgap for Windows users (on all versions of Windows supporting Java 8).
  • Removing all JavaFX functionality would remove (require re-implementing) the marquee feature of 2017 - the re-orderable lists. That would require inordinate time as well, and thus would essentially amount to a loss of functionality.
  • Figuring out how to automagically download JavaFX when required is likely the best option. But realistically that's probably not going to be done by Tuesday, when Java 11 releases.
  • Updating the minimum requirement to Java 11 would leave behind those whose systems cannot run Java 11, but can run Java 8. Those users are known to exist. It would also require everyone else to upgrade to a brand-new version of Java. For a conservative user base (the editor is for a program built in 2001-2003, after all), this is not desirable.

What I'm thinking is:

Round 1:

  • Release a 1.25 that would remove the at-initial-program-start dependency. I.E. If Java 11 is detected, don't initialize the JavaFX file I/O dialogs there. This at least gets you to the main splash screen.
  • 1.25 would include a new Java 11 widget that would always display when run on Java 11, alerting that Java 11 breaks compatibility, and to either use the Windows XP build that bundles Java 8, or to use the Legacy (Swing-only) build (1.19).

Round 2:

  • Update Windows XP build and Legacy build.

Round 3:

  • Figure out how to automatically download the Java 11 JavaFX runtimes from the splash screen. Update the Java 11 widget to have a download link (with a Swing progress bar).
Status
REPORTED
Submitter
bitbucket:QuintillusCFC
Assigned to
No-one
Submitted
6 years ago
Updated
4 years ago
Labels
No labels applied.

~adj 4 years ago

Notes:

  • Can detect Java version by looking @ runtime, seeing if the part before the dot (if there's a dot - isn't always) is > 1 as an integer
  • FileIO.java line 84 is the first place where things blow up. java.lang.NoClassDefFoundError. Will need to work around this.
Register here or Log in to comment, or comment via email.