JAL-629 fix opening files
[jalview.git] / src / jalview / gui / Desktop.java
index 5b0d45a..16603df 100644 (file)
@@ -121,6 +121,7 @@ import jalview.urls.IdOrgSettings;
 import jalview.util.BrowserLauncher;
 import jalview.util.ChannelProperties;
 import jalview.util.ImageMaker.TYPE;
+import jalview.util.LaunchUtils;
 import jalview.util.MessageManager;
 import jalview.util.Platform;
 import jalview.util.ShortcutKeyMaskExWrapper;
@@ -182,7 +183,7 @@ public class Desktop extends jalview.jbgui.GDesktop
 
   private static final String EXPERIMENTAL_FEATURES = "EXPERIMENTAL_FEATURES";
 
-  protected static final String CONFIRM_KEYBOARD_QUIT = "CONFIRM_KEYBOARD_QUIT";
+  public static final String CONFIRM_KEYBOARD_QUIT = "CONFIRM_KEYBOARD_QUIT";
 
   public static HashMap<String, FileWriter> savingFiles = new HashMap<String, FileWriter>();
 
@@ -413,8 +414,11 @@ public class Desktop extends jalview.jbgui.GDesktop
      */
     if (Platform.isLinux())
     {
-      jalview.bin.Console.info(
-              "Linux platform only! You may have the following warning next: \"WARNING: An illegal reflective access operation has occurred\"\nThis is expected and cannot be avoided, sorry about that.");
+      if (LaunchUtils.getJavaVersion() >= 11)
+      {
+        jalview.bin.Console.info(
+                "Linux platform only! You may have the following warning next: \"WARNING: An illegal reflective access operation has occurred\"\nThis is expected and cannot be avoided, sorry about that.");
+      }
       try
       {
         Toolkit xToolkit = Toolkit.getDefaultToolkit();
@@ -445,24 +449,6 @@ public class Desktop extends jalview.jbgui.GDesktop
       }
     }
 
-    /**
-     * APQHandlers sets handlers for About, Preferences and Quit actions
-     * peculiar to macOS's application menu. APQHandlers will check to see if a
-     * handler is supported before setting it.
-     */
-    try
-    {
-      APQHandlers.setAPQHandlers(this);
-    } catch (Exception e)
-    {
-      System.out.println("Cannot set APQHandlers");
-      // e.printStackTrace();
-    } catch (Throwable t)
-    {
-      jalview.bin.Console
-              .warn("Error setting APQHandlers: " + t.toString());
-      jalview.bin.Console.trace(Cache.getStackTraceString(t));
-    }
     setIconImages(ChannelProperties.getIconList());
 
     addWindowListener(new WindowAdapter()