JAL-3120 JAL-3130 can't read "java.specification.version" in JalviewJS
authorgmungoc <g.m.carstairs@dundee.ac.uk>
Tue, 5 Nov 2019 17:07:33 +0000 (17:07 +0000)
committergmungoc <g.m.carstairs@dundee.ac.uk>
Tue, 5 Nov 2019 17:07:33 +0000 (17:07 +0000)
src/jalview/gui/Desktop.java
src/jalview/util/ShortcutKeyMaskExWrapper.java

index 5800a47..ec6b795 100644 (file)
@@ -367,20 +367,18 @@ public class Desktop extends jalview.jbgui.GDesktop
     }
     */
 
-    try
-    {
-      APQHandlers.setAPQHandlers(this);
-    } catch (Exception e)
-    {
-      System.out.println("Cannot set APQHandlers");
-      // e.printStackTrace();
-    } catch (Throwable t)
+    if (!Platform.isJS())
     {
-      System.out.println("Cannot set APQHandlers");
-      // t.printStackTrace();
+      try
+      {
+        APQHandlers.setAPQHandlers(this);
+      } catch (Throwable t)
+      {
+        System.out.println("Error setting APQHandlers: " + t.toString());
+        // t.printStackTrace();
+      }
     }
 
-
     addWindowListener(new WindowAdapter()
     {
 
index f73b8d4..c83da4e 100644 (file)
@@ -17,8 +17,9 @@ public class ShortcutKeyMaskExWrapper
 
   static
   {
-    specversion = Float
-            .parseFloat(System.getProperty("java.specification.version"));
+    specversion = Platform.isJS() ? Float.valueOf(8)
+            : Float.parseFloat(
+                    System.getProperty("java.specification.version"));
     modern = 11;
 
     if (specversion >= modern)