JDK-8155835 : FXUIToolkit.showFileChooser() fails when jre is below 7u21
  • Type: Bug
  • Component: deploy
  • Sub-Component: javafx
  • Affected Version: 8u102,9
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2016-05-02
  • Updated: 2016-10-13
  • Resolved: 2016-05-03
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
8u112Fixed 9 b120Fixed
When  running JDK8 or JDK9 deploy code with jre below 7u21, calls to toolkis's abstract method showFileChooser fail with AbstractMethodException.
Before 7u21 the call had 4 args, and after it has 5.
We should catch this exception and try to do something (like calling the 4 arg version thru reflection).

you can see this behavior by installing JDK9 and 7u10 and running :

Crucible review: https://java.se.oracle.com/code/cru/CR-JDK9CLIENT-1931

Verified that this can easily be fixed by changing com.sun.deploy.uitoolkit.ui.UIFactory. instead of having one abstract 5 arg version of showFileChooser, we have two methods. one 5 arg and one 4 arg. The 5 arg version calls the 4 arg version, but is overridden in awt toolkit or FX toolkit from 7u21 on. The 4 arg version is just a dummy, but is overridden in FX pre-7u21 (which is the only time it is actually called).