I develop a java application using openjfx
modules.
I now want to use DirectoryChooser
to let the user select several files as an input (code below). Everytime I start the application from the IDE it crashes with the exception below. By crashing I mean totally terminates (not freezing).
I also tried some sample code like this to figure out if there is anything wrong with my implementation but each sample I found gave me the same issue.
I'm unsure if this is a general issue/bug because I saw old bugs, in the oracle bug tracker but they where all marked as fixed.
I would be happy if someone could provide some help on this. I would even be happy with a workaround that just avoids DirectoryChooser
if there is any.
Steps to reproduce:
Background information:
Exception
2020-01-30 17:18:31.288 java[49749:1319417] *** Terminating app due to uncaught exception 'NSObjectNotAvailableException', reason: 'GlassOpenPanel is not a supported subclass for sandboxing'
*** First throw call stack:
(
0 CoreFoundation 0x00007fff364ea8ab __exceptionPreprocess + 250
1 libobjc.A.dylib 0x00007fff6c75b805 objc_exception_throw + 48
2 CoreFoundation 0x00007fff364ea701 +[NSException raise:format:] + 189
3 AppKit 0x00007fff33d43aa9 +[NSSavePanel(Instantiation) _crunchyRawUnbonedPanel] + 368
4 libglass.dylib 0x00000001370a2ba6 Java_com_sun_glass_ui_mac_MacCommonDialogs__1showFolderChooser + 358
5 ??? 0x0000000117695950 0x0 + 4687747408
6 ??? 0x000000011768fa00 0x0 + 4687723008
)
libc++abi.dylib: terminating with uncaught exception of type NSException
Solution
As suggested by mipa increasing the OpenJFX version number solved the problem.
At the moment, it seems working for OpenJFX version 14-ea+7 and 15-ea+1 from MavenCentral
Give JavaFX 13 a try and then report back.