JAL-3253-applet headless branch - just experimenting.
[jalview.git] / src / jalview / bin / Jalview.java
index fae2b75..2752008 100755 (executable)
@@ -292,6 +292,7 @@ public class Jalview implements ApplicationSingletonI, JalviewJSApi
     }
     else
     {
+      // BH 2019.08.26 cannot pass null
       System.setSecurityManager(null);
     }
 
@@ -342,6 +343,9 @@ public class Jalview implements ApplicationSingletonI, JalviewJSApi
               || "true".equals(System.getProperty("java.awt.headless")))
       {
         headless = true;
+
+        System.out.println("Headless operation detected.");
+
       }
 
       // anything else!
@@ -398,7 +402,9 @@ public class Jalview implements ApplicationSingletonI, JalviewJSApi
 
     try
     {
-      UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
+      UIManager.setLookAndFeel(
+              headless ? "javax.swing.plaf.metal.MetalLookAndFeel"
+                      : UIManager.getSystemLookAndFeelClassName());
     } catch (Exception ex)
     {
       System.err.println("Unexpected Look and Feel Exception");
@@ -616,7 +622,8 @@ public class Jalview implements ApplicationSingletonI, JalviewJSApi
         {
           if (!(new File(file)).exists())
           {
-            System.out.println("Can't find " + file);
+            System.out.println(
+                    "Can't find " + new File(file).getAbsolutePath());
             if (headless)
             {
               System.exit(1);
@@ -753,7 +760,10 @@ public class Jalview implements ApplicationSingletonI, JalviewJSApi
 
         if (aparser.contains(ArgsParser.SHOWOVERVIEW))
         {
-          af.overviewMenuItem_actionPerformed(null);
+          if (!headless)
+          {
+            af.overviewMenuItem_actionPerformed(null);
+          }
           System.out.println("CMD [showoverview] executed successfully!");
         }