ensured properties are loaded before loggers are initialised.
[jalview.git] / src / jalview / bin / Jalview.java
index 9a85471..0272751 100755 (executable)
@@ -20,8 +20,6 @@ package jalview.bin;
 \r
 import jalview.gui.*;\r
 \r
-import org.apache.log4j.*;\r
-\r
 import javax.swing.*;\r
 \r
 import java.util.Vector;\r
@@ -59,8 +57,11 @@ public class Jalview
         System.out.println("Usage: jalview -open [FILE] [OUTPUT_FORMAT] [OUTPUT_FILE]\n\n"\r
                            +"-nodisplay\tRun Jalview without User Interface.\n"\r
                            +"-props FILE\tUse the given Jalview properties file instead of users default.\n"\r
-                           +"-groups FILE\tUse the given file to mark groups on the alignment. \nGroups file is in the following tab delimited format\n"\r
-                           +"TEXT<tab>SEQUENCE_ID<tab>SEQUENCE_INDEX<tab>START_RESIDUE<tab>END_RESIDUE<tab>COLOUR\n"\r
+                           +"-groups FILE\tUse the given file to mark groups on the alignment."\r
+                           +"\nThe first lines of the groups file lists the GroupName and GroupColours"\r
+                           +" to be used in the alignment. Use the GROUPNAME label for each of your sequences. "\r
+                           +"\nGROUPNAME<tab>GROUPCOLOUR\n"\r
+                           +"TEXT<tab>SEQUENCE_ID<tab>SEQUENCE_INDEX<tab>START_RESIDUE<tab>END_RESIDUE<tab>GROUPNAME\n"\r
                            +"SequenceID is used in preference to SequenceIndex if both are provided.\n"\r
                            +"Enter ID_NOT_SPECIFIED for SEQUENCE_ID or -1 for SEQUENCE_INDEX if unknown.\n"\r
                            +"COLOUR can be hexadecimal RGB or 'red', 'blue' etc.\n\n"\r
@@ -78,10 +79,12 @@ public class Jalview
         System.exit(0);\r
           }\r
 \r
+          Cache.loadProperties(aparser.getValue("props")); // must do this before anything else!\r
 \r
           if (aparser.contains("nodisplay"))\r
+          {\r
             System.setProperty("java.awt.headless", "true");\r
-\r
+          }\r
           if (System.getProperty("java.awt.headless") != null\r
               && System.getProperty("java.awt.headless").equals("true"))\r
           {\r
@@ -101,8 +104,6 @@ public class Jalview
             System.exit(0);\r
           }\r
 \r
-        Cache.loadProperties(aparser.getValue("props"));\r
-\r
         Desktop desktop = null;\r
         if( !headless )\r
         {\r
@@ -147,7 +148,8 @@ public class Jalview
               if (! (new java.io.File(file)).exists())\r
               {\r
                 System.out.println("Can't find " + file);\r
-                System.exit(1);\r
+                if(headless)\r
+                  System.exit(1);\r
               }\r
             }\r
 \r
@@ -240,10 +242,6 @@ public class Jalview
               desktop.LoadFile(file, protocol, format);\r
             }\r
           }\r
-\r
-\r
-          if (desktop==null)\r
-            System.exit(0);\r
     }\r
 }\r
 \r