The app context is necessary to work around two bugs concerning applets and Java Webstart, both technologies no longer work with Java >= 9 anyway (they are deprecated since Java 9, Java Webstart was removed in Java 11,
the applets are removed in Java 17). We could simply not try to get the app context when we use Java >= 17.