JAL-3065 - amended commit 4906697ab6e5a79fbce3baae89f7f64178c9a739 to exclude ...
[jalview.git] / src / jalview / bin / Jalview.java
index 287096d..adf3773 100755 (executable)
@@ -61,6 +61,7 @@ import java.util.HashMap;
 import java.util.Map;
 import java.util.Vector;
 
+import javax.swing.LookAndFeel;
 import javax.swing.UIManager;
 
 import groovy.lang.Binding;
@@ -69,7 +70,14 @@ import groovy.util.GroovyScriptEngine;
 /**
  * Main class for Jalview Application <br>
  * <br>
- * start with java -Djava.ext.dirs=$PATH_TO_LIB$ jalview.bin.Jalview
+ * start with: java -classpath "$PATH_TO_LIB$/*:$PATH_TO_CLASSES$" \
+ * jalview.bin.Jalview
+ * 
+ * or on Windows: java -classpath "$PATH_TO_LIB$/*;$PATH_TO_CLASSES$" \
+ * jalview.bin.Jalview jalview.bin.Jalview
+ * 
+ * (ensure -classpath arg is quoted to avoid shell expansion of '*' and do not
+ * embellish '*' to e.g. '*.jar')
  * 
  * @author $author$
  * @version $Revision$
@@ -264,7 +272,7 @@ public class Jalview
     {
       error.printStackTrace();
       System.out.println("\nEssential logging libraries not found."
-              + "\nUse: java -Djava.ext.dirs=$PATH_TO_LIB$ jalview.bin.Jalview");
+              + "\nUse: java -classpath \"$PATH_TO_LIB$/*:$PATH_TO_CLASSES$\" jalview.bin.Jalview");
       System.exit(0);
     }
 
@@ -280,25 +288,32 @@ public class Jalview
     }
     if (Platform.isAMac())
     {
+
+      LookAndFeel lookAndFeel = ch.randelshofer.quaqua.QuaquaManager
+              .getLookAndFeel();
       System.setProperty("com.apple.mrj.application.apple.menu.about.name",
               "Jalview");
       System.setProperty("apple.laf.useScreenMenuBar", "true");
-      try
-      {
-        UIManager.setLookAndFeel(
-                ch.randelshofer.quaqua.QuaquaManager.getLookAndFeel());
-      } catch (Throwable e)
+      if (lookAndFeel != null)
       {
-        System.err.println(
-                "Failed to set QuaQua look and feel: " + e.toString());
+        try
+        {
+          UIManager.setLookAndFeel(lookAndFeel);
+        } catch (Throwable e)
+        {
+          System.err.println(
+                  "Failed to set QuaQua look and feel: " + e.toString());
+        }
       }
-      if (!ch.randelshofer.quaqua.QuaquaManager.getLookAndFeel()
-              .equals(UIManager.getLookAndFeel()))
+      if (lookAndFeel == null || !(lookAndFeel.getClass()
+              .isAssignableFrom(UIManager.getLookAndFeel().getClass()))
+              || !UIManager.getLookAndFeel().getClass().toString()
+                      .toLowerCase().contains("quaqua"))
       {
         try
         {
           System.err.println(
-                  "Quaqua LaF not available. Using VAqua(4).");
+                  "Quaqua LaF not available on this plaform. Using VAqua(4).\nSee https://issues.jalview.org/browse/JAL-2976");
           UIManager.setLookAndFeel("org.violetlib.aqua.AquaLookAndFeel");
         } catch (Throwable e)
         {