Merge branch 'task/JAL-3348_document_cli_memory_settings_when_launching_jalview'...
authorJim Procter <jprocter@issues.jalview.org>
Thu, 4 Jul 2019 08:08:21 +0000 (09:08 +0100)
committerJim Procter <jprocter@issues.jalview.org>
Thu, 4 Jul 2019 08:08:21 +0000 (09:08 +0100)
16 files changed:
getdown/lib/getdown-core.jar
getdown/lib/getdown-launcher.jar
getdown/src/getdown/ant/pom.xml
getdown/src/getdown/core/pom.xml
getdown/src/getdown/core/src/main/java/com/threerings/getdown/data/Application.java
getdown/src/getdown/core/src/main/java/com/threerings/getdown/util/Config.java
getdown/src/getdown/launcher/pom.xml
getdown/src/getdown/pom.xml
help/help/help.jhm
help/help/helpTOC.xml
help/help/html/features/clarguments.html
help/help/html/features/commandline.html
help/help/html/features/jvlfiles.html [new file with mode: 0644]
help/help/html/memory.html
j11lib/getdown-core.jar
j8lib/getdown-core.jar

index 7849bc7..34723c1 100644 (file)
Binary files a/getdown/lib/getdown-core.jar and b/getdown/lib/getdown-core.jar differ
index 7f99732..edeadaa 100644 (file)
Binary files a/getdown/lib/getdown-launcher.jar and b/getdown/lib/getdown-launcher.jar differ
index a2f95e3..0064425 100644 (file)
@@ -4,7 +4,7 @@
   <parent>
     <groupId>com.threerings.getdown</groupId>
     <artifactId>getdown</artifactId>
-    <version>1.8.3-1.1.4_JVL</version>
+    <version>1.8.3_1.1.7_JVL</version>
   </parent>
 
   <artifactId>getdown-ant</artifactId>
index 4cd0507..80d0c38 100644 (file)
@@ -4,7 +4,7 @@
   <parent>
     <groupId>com.threerings.getdown</groupId>
     <artifactId>getdown</artifactId>
-    <version>1.8.3-1.1.4_JVL</version>
+    <version>1.8.3_1.1.7_JVL</version>
   </parent>
 
   <artifactId>getdown-core</artifactId>
index 2dddd6f..7c2a427 100644 (file)
@@ -286,7 +286,6 @@ public class Application
        _envc = envc;
        _config = getLocalPath(envc.appDir, CONFIG_FILE);
        _backupConfig = getLocalPath(envc.appDir, BACKUP_CONFIG_DIR+File.separator+CONFIG_FILE);
-       log.warning("Backup config file now", "_backupConfig", _backupConfig, "exists", _backupConfig.exists(), "isReadable", _backupConfig.canRead());
     }
 
     /**
@@ -820,14 +819,16 @@ public class Application
             ARG: for (int i = 0; i < _jvmargs.size(); i++) {
               if (_jvmargs.get(i) instanceof java.lang.String && _jvmargs.get(i).startsWith("-Xmx")) {
                 _jvmargs.remove(i);
+                break ARG;
               }
             }
             addAll(maxMemHeapArg, _jvmargs);
+            log.info("Max memory set", "maxMemHeapArg", maxMemHeapArg[0]);
             
           }
 
         } else if (jvmmempc != -1) {
-          System.out.println("'jvmmempc' value must be in range 0 to 100 (read as '"+Integer.toString(jvmmempc)+"')");
+          log.warning("'jvmmempc' value must be in range 0 to 100 (read as '"+Integer.toString(jvmmempc)+"')");
         }
 
         // get the set of optimum JVM arguments
@@ -1129,7 +1130,7 @@ public class Application
           if (j > -1) {
             ext = filename.substring(j+1);
           }
-          if (LOCATOR_FILE_EXTENSION.equals(ext.toLowerCase())) {
+          if (ext != null && LOCATOR_FILE_EXTENSION.equals(ext.toLowerCase())) {
             // this file extension should have been dealt with in Getdown class
           } else {
             _appargs.add(0, "-open");
index 6ad2b4f..8767ae0 100644 (file)
@@ -471,7 +471,7 @@ public class Config
 
     private final Map<String, Object> _data;
  
-    public static final List<String> allowedReplaceKeys = Arrays.asList("appbase","apparg","jvmarg"); // these are the ones we might use
+    public static final List<String> allowedReplaceKeys = Arrays.asList("appbase","apparg","jvmarg","jvmmempc"); // these are the ones we might use
     public static final List<String> allowedMergeKeys = Arrays.asList("apparg","jvmarg"); // these are the ones we might use
     //private final List<String> allowedMergeKeys = Arrays.asList("apparg","jvmarg","resource","code","java_location"); // (not exhaustive list here)
 }
index 4c6b982..4755cc6 100644 (file)
@@ -4,7 +4,7 @@
   <parent>
     <groupId>com.threerings.getdown</groupId>
     <artifactId>getdown</artifactId>
-    <version>1.8.3-1.1.4_JVL</version>
+    <version>1.8.3_1.1.7_JVL</version>
   </parent>
 
   <artifactId>getdown-launcher</artifactId>
index 24efba8..2807be5 100644 (file)
@@ -10,7 +10,7 @@
   <groupId>com.threerings.getdown</groupId>
   <artifactId>getdown</artifactId>
   <packaging>pom</packaging>
-  <version>1.8.3-1.1.4_JVL</version>
+  <version>1.8.3_1.1.7_JVL</version>
 
   <name>getdown</name>
   <description>An application installer and updater.</description>
index 0802bf1..47f7d53 100755 (executable)
@@ -61,6 +61,7 @@
    <mapID target="strucprefs" url="html/features/preferences.html#structure"/>     
    <mapID target="commandline" url="html/features/commandline.html"/>
    <mapID target="clarguments" url="html/features/clarguments.html"/>
+   <mapID target="jvlfiles" url="html/features/jvlfiles.html"/>
    <mapID target="io" url="html/io/index.html"/>
    <mapID target="io.modellerpir" url="html/io/modellerpir.html"/>
    <mapID target="io.seqreport" url="html/io/exportseqreport.html"/>
index 179fb06..7e358d6 100755 (executable)
                        </tocitem>
                </tocitem>
                <tocitem text="Preferences" target="preferences" />
-               <tocitem text="Memory Settings" target="memory" expand="false"/>
                <tocitem text="Scripting with Groovy" target="groovy">
                        <tocitem text="Groovy Features Counter example" target="groovy.featurescounter"/>
                </tocitem>
                <tocitem text="Command Line" target="commandline" expand="false">
                        <tocitem text="Command Line Arguments" target="clarguments" />
-               </tocitem>
+    <tocitem text="Memory Settings" target="memory" expand="false"/>
+    <tocitem text="Jalview Launch Files" target="jvlfiles" expand="false"/>
+    </tocitem>
                <tocitem text="Privacy" target="privacy" />
        </tocitem>
        <tocitem text="Useful information" expand="true">
index ebdfcf3..60db069 100644 (file)
   See
   <a href="commandline.html">running Jalview from the command line</a>
   for more information.
+  <br />
+  <br />Jalview processes arguments on the command line sequentially. If
+  you would like to pass a <a href="jvlfiles.html">'JVL' file</a> containing
+  <a href="../memory.html">memory settings</a> or any other launch
+  parameters, then include it at the beginning of the command line to
+  ensure they are processed before any remaining arguments.
   <br>
   <table width="100%" border="1" cellspacing="0" cellpadding="0">
     <tr>
index 92d9323..27a1a68 100644 (file)
   <p>
     <strong>Running Jalview from the command line</strong>
   </p>
-  <p>Jalview is most easily run from the command line if you have
-    built it from source, or via the 'Jalview' executable created from
-    the InstallAnywhere Jalview installation. Both of these mechanisms
-    allow true command line execution of Jalview - allowing you to
-    provide additional options.</p>
-  <p>The Java Webstart version of Jalview can be executed from the
-    command line using something like :
-  <pre>javaws http://www.jalview.org/webstart/jalview.jnlp -open
- <em>yourFileName</em>
-  </pre>
-  But, this is not guaranteed to work on all versions of webstart on all
-  operating systems, and doesn't let you execute Jalview with any
-  additional parameters.
   <p>
-    <strong>Running Jalview from the InstallAnywhere
-      installation</strong>
+    Jalview can be run from the command line, and provides a <a
+      href="clarguments.html">range of arguments</a>. These arguments
+    can also be passed via <strong>.JVL</strong> files, which are opened
+    automatically by the Jalview application when double-clicked in a
+    file browser on Windows and OSX.
   </p>
+  The way that you launch Jalview from the command line depends on the
+  platform you are on, and how it has been installed.
+
+  <ul>
+    <li>Standard installation on Linux/Unix:<pre>
+       /PATH_TO_JALVIEW/Jalview -open http://www.jalview.org/examples/jpred_msa.fasta -annotations http://www.jalview.org/examples/jpred_msa.seq.concise -colour Clustal</pre>
+    </li>
+    <li>Standard installation on Windows:<pre>
+      \PATH_TO_JALVIEW\Jalview.exe -open %HOMEPATH%\myalignment.fa</pre>
+    </li>
+    <li>OSX Application:<pre>
+open /Applications/Jalview.app --args -open ~/myalignment.fa</pre><em>(put
+        all the Jalview arguments <em>after</em> the --args parameter)
+    </em><br />
+    <br /></li>
+    <li>Jalview standalone executable Jar<pre>
+        &lt;Path to Java home&gt;/bin/java -jar %lt;Path to Jalview Jar&gt;/jalview-all-1.8.jar -open myalignment.fa</pre></li>
+  </ul>
   <p>
-    If you install with InstallAnywhere you can use several more
-    commands. However, if you call the application with the link
-    provided by InstallAnywhere any output from the application will be
-    sent to output.txt, not standard out.<br> The Jalview
-    application also requires a number of additional libraries on the
-    class path. The command line below adds all the jar files in the
-    Jalview installation's 'lib' directory to the classpath, as well as
-    the Jalview application jar file:
+    If you have installed Jalview via <em>conda</em> or another package
+    manager then you most likely have a 'jalview' command available in
+    your terminal shell's default path. Alternately, if you have built
+    Jalview from source, then take a look at the doc/building.md file
+    included in the source distribution.
   </p>
-  <pre>java -classpath "$INSTALL_DIR$/lib/*:$INSTALL_DIR$/jalview.jar" jalview.bin.Jalview -open [FILE] </pre>
   <p>
     Use '-help' to get more information on the <a
-      href="clarguments.html">command line arguments</a> that
-    Jalview accepts.
+      href="clarguments.html">command line arguments</a> that Jalview
+    accepts.
+  </p>
+  <p>
+    <strong>Passing JVM Arguments to Jalview</strong><br /> If you need
+    to modify parameters for Jalview's Java Virtual Machine, then take a
+    look at the instructions for how to <a href="../memory.html#jvm">setting
+      the JVM's maximum memory</a>.
   </p>
   <p>&nbsp;</p>
   <p>&nbsp;</p>
diff --git a/help/help/html/features/jvlfiles.html b/help/help/html/features/jvlfiles.html
new file mode 100644 (file)
index 0000000..15df5d4
--- /dev/null
@@ -0,0 +1,70 @@
+<html>
+<!--
+ * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
+ * Copyright (C) $$Year-Rel$$ The Jalview Authors
+ * 
+ * This file is part of Jalview.
+ * 
+ * Jalview is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License 
+ * as published by the Free Software Foundation, either version 3
+ * of the License, or (at your option) any later version.
+ *  
+ * Jalview is distributed in the hope that it will be useful, but 
+ * WITHOUT ANY WARRANTY; without even the implied warranty 
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
+ * PURPOSE.  See the GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License
+ * along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
+ * The Jalview Authors are detailed in the 'AUTHORS' file.
+ -->
+<title>JVL - Jalview Launch Files</title>
+<body>
+  <p>
+    <strong>Jalview Launch Files - JVL</strong>
+  </p>
+  <p>Files with a '.jvl' (or .JVL) extension can be opened by the
+    Jalview desktop application, and allow you to:</p>
+  <ul>
+    <li><strong>Switch between different Jalview Versions</strong></li>
+    <li><strong>Configure the <a href="../memory.html">proportion
+          of memory</a> allocated to Jalview
+    </strong></li>
+    <li><strong>Import data and pass <a
+        href="clarguments.html">command line arguments</a></strong></li>
+  </ul>
+  <p>
+    Some example JVL files are given below - copy and paste them into a
+    text editor and save them as a file with the extension '.jvl'. To
+    test, open your saved .jvl file via the OSX File Chooser or Windows
+    file explorer, or pass it to Jalview via the <a
+      href="../commandline.html">command line</a>
+  </p>
+  <p>
+    <strong>Passing command line arguments</strong>
+  <pre>
+# Jalview Launch File
+# Please install the Jalview Desktop from 
+# http://www.jalview.org/getdown/release
+# and then try to open this file again
+jalview.apparg=-open
+jalview.apparg=http://www.jalview.org/examples/jpred_msa.fasta
+jalview.apparg=-annotations
+jalview.apparg=http://www.jalview.org/examples/jpred_msa.seq.concise
+jalview.apparg=-colour
+jalview.apparg=Clustal
+</pre>
+  <p>
+    <strong>Launching a different version of Jalview</strong>
+  <pre>
+# Jalview Launch File
+# Please install the Jalview Desktop from 
+# http://www.jalview.org/getdown/release
+# and then try to open this file again
+appbase=http://www.jalview.org/old/v2_10_5/
+</pre>
+  For security, the Jalview application will only allow
+  <em>appbase</em> URLs from www.jalview.org, or your local file system.
+</body>
+</html>
index e583398..4baebf2 100755 (executable)
       <strong>Memory Usage Settings for Jalview</strong>
     </center>
   </h2>
+  <p>When launched as an Application, Jalview will automatically
+    configure the amount of memory allocated to the program to be 90% of
+    physical memory. You may wish to change this behaviour -
+    particularly if you are working on a machine that runs other memory
+    intensive processes.
   <p>
-    When launched as an Application, Jalview automatically tries to
-    maximise the amount of memory allocated to it, but sometimes it may
-    run out of memory. This is because of the way that Java runs on a
-    computer - what is actually run is a program called a virtual
-    machine (the JVM) which executes the java instructions. The JVM has
-    limits on the memory that can be allocated to the java program - and
-    you might need to increase them if you are working with particularly
-    large datasets.<br> If Jalview has not explicitly told you that
-    it has run out of memory, then a common sign is that a function that
-    normally works seems to have no effect when working with a larger
-    set of sequences (this might include open dialog boxes for saving
-    PNG files, or when interpreting the result of a web service
-    calculation).
+    <em>Signs that Jalview is Running out of Memory</em><br /> If
+    Jalview has not explicitly told you that it has run out of memory,
+    then a common sign is that a function that normally works seems to
+    have no effect when working with a larger set of sequences (this
+    might include open dialog boxes for saving PNG files, or when
+    interpreting the result of a web service calculation).
   </p>
   <p>
     <em>Jalview Memory Usage Monitor</em>: If you are concerned about
     window's background.
   </p>
   <p>
-    <em>Increasing the memory available to Jalview</em><br>
-    Since Jalview 2.11, the program automatically configures the JVM memory settings to set the maximum memory available to Jalview to be 90% of physical memory. 
-      <p>&nbsp;</p>
+    <em>Increasing the memory available to Jalview</em><br /> The
+    amount of memory allocated is defined wheb Jalview is launched
+    because of the way that Java runs on a computer - what is actually
+    run is a program called a Java virtual machine (a JVM) which
+    executes the java program instructions. The JVM has limits on the
+    memory that can be allocated to the java program - and it is often
+    necessary to adjust them if you are working with particularly large
+    datasets, or need to make room for other processes on the machine.<br />
+    <br />Jalview 2.11 includes a launcher that automatically
+    configures the proportion of memory allocated to Jalview's JVM, and
+    its behaviour can be altered in a number of different ways:
+  </p>
+
+  <ul>
+    <li><em><font size="3">JVL file</font></em> <br /> The easiest
+      way to launch Jalview with a different percentage of physical
+      memory available is to create a text file with extension <em>.jvl</em>
+      and a single line to specify the percentage of memory you wish
+      Jalview to request: <pre>
+      jalview.jvmmempc=50</pre> In Windows and in macOS you can then launch Jalview by
+      double clicking on this file, and your memory setting will be used
+      instead of the default value. <br /> <br /> In Linux or other
+      unix variants you can launch Jalview on the command line and
+      provide your JVL file as an argument with <pre>
+      /PATH_TO_JALVIEW/Jalview /path/to/file/mymemorysetting.jvl</pre> If you want to use a memory setting like this and open a
+      file you can use both the jvl and alignment files as command line
+      arguments, but you must put the <em>jvl</em> file first, e.g. <pre>
+      /PATH_TO_JALVIEW/Jalview /path/to/file/mymemorysetting.jvl /path/to/alignments/myalignment.fa</pre> Alternatively, you can use the standard Jalview command line
+      arguments with or without the jvl file (first), e.g. <pre>
+       /PATH_TO_JALVIEW/Jalview /path/to/file/mymemorysetting.jvl -open http://www.jalview.org/examples/jpred_msa.fasta -annotations http://www.jalview.org/examples/jpred_msa.seq.concise -colour Clustal</pre> You can use command line arguments to control memory
+      settings in Windows and macOS too: <br /> In Windows you must
+      use, e.g. <pre>
+      \PATH_TO_JALVIEW\Jalview.exe %HOMEPATH%\mymemorysetting.jvl -open %HOMEPATH%\myalignment.fa</pre> In macOS you can use the macOS <em>open</em> command like this: <pre>
+      open /Applications/Jalview.app --args ~/mymemorysetting.jvl -open ~/myalignment.fa</pre><em>(put all the Jalview arguments <em>after</em> the --args
+        parameter)
+    </em><br/><br/></li>
+    <li><em><font size="3"><a name="jvm"/>Directly opening Jalview
+          with a JVM</font></em> <br /> Launching Jalview directly with a JVM is
+      entirely possible, but is not recommended for regular interactive
+      use because it bypasses Jalview's launcher which also handles
+      automatic updates and configuration of other aspects of Jalview
+      operation. <br /> However by launching Jalview in this way you
+      have full access to the Java command line arguments. In particular
+      you can set the maximum allowed memory with the <em>-Xmx...</em>
+      JVM argument. <br /> <em>-Xmx</em> should be immediately followed
+      (no space or equals) by the maximum amount of memory specified in
+      bytes, or in kilobytes, megabytes or gigabytes by following the
+      number with a "k", "m" or "g" respectively. <br />For example: <pre>
+      -Xmx8g</pre>Jalview binaries for Windows and macOS are distributed
+      with their own JVM which you will find in
+      <ul>
+        <li><em>Windows:</em> .../Jalview/jre/bin/java.exe</li>
+        <li><em>macOS:</em>
+          .../Jalview.app/Contents/Resources/app/jre/Contents/Home/bin/java</li>
+      </ul> For linux and other unixes you will have to install a Java 1.8
+      JRE (we recommend the ones found at <a
+      href="https://adoptopenjdk.net">https://adoptopenjdk.net/</a>) <br />
+      <br /> You will also need to reference the "appdir" release
+      folder with all of the Jalview jar files.
+      <ul>
+        <li>On Windows this will be <pre>\PATH_TO_JALVIEW\release</pre>
+        </li>
+        <li>On macOS it will be <pre>/Applications/Jalview.app/Contents/Resources/app/release</pre>
+          and on linux or unix <pre>/PATH_TO_JALVIEW/release</pre>
+        </li>
+      </ul> Assuming the <em>java</em> (or <em>java.exe</em> on Windows)
+      commands are available to you, you can run, e.g. <pre>
+      java -Xmx1500m -cp "/PATH_TO_RELEASE_DIR/*" jalview.bin.Jalview
+      </pre> Or on Windows <pre>
+      java.exe -Xmx1500m -cp "\PATH_TO_RELEASE_DIR\*" jalview.bin.Jalview
+      </pre> <em>Note:</em> for this to work the classpath argument wildcard <strong>must</strong> be simply
+      a '*' and not '*.jar'. <br /> <br />
+      You can also add other <a href="features/commandline.html">Jalview
+        command line arguments</a> as above after the <em>jalview.bin.Jalview</em>
+      class name, but <strong>you cannot use <em>jvl</em> files
+    </strong> if launching Jalview in this way.</li>
+  </ul>
 </body>
 </html>
index 7849bc7..34723c1 100644 (file)
Binary files a/j11lib/getdown-core.jar and b/j11lib/getdown-core.jar differ
index 7849bc7..34723c1 100644 (file)
Binary files a/j8lib/getdown-core.jar and b/j8lib/getdown-core.jar differ