Merge branch 'spike/relaunch_memsetingds' into spikes/jim
[jalview.git] / src / jalview / bin / Jalview.java
index 30620a1..f776b27 100755 (executable)
@@ -70,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$
@@ -149,7 +156,6 @@ public class Jalview
           af.setProgressBar(MessageManager
                   .getString("status.das_features_being_retrived"), id);
           af.featureSettings_actionPerformed(null);
-          af.featureSettings.fetchDasFeatures(dasSources, true);
           af.setProgressBar(null, id);
           synchronized (us)
           {
@@ -179,7 +185,18 @@ public class Jalview
    */
   public static void main(String[] args)
   {
-    instance = new Jalview();
+    float ONE_MB = 1048576f;
+    Runtime runtime = Runtime.getRuntime();
+    float maxMemory = runtime.maxMemory() / ONE_MB;
+    if (maxMemory < 1024 * 15)
+    {
+      System.exit();
+    }
+
+    if (System.ge)
+    {
+      instance = new Jalview();
+    }
     instance.doMain(args);
   }
 
@@ -265,7 +282,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);
     }