From d5e758fa924437e30dc65b80a46cafcf4691da2f Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Wed, 5 Sep 2018 09:01:50 +0100 Subject: [PATCH] JAL-3065 - amended commit 4906697ab6e5a79fbce3baae89f7f64178c9a739 to exclude .settings/..groovy Added notes to the instructions, also adjusted the jalviewDesktopRunner test to lookup OS and use ';' or ':' accordingly. All the CommandLineOperations tests failed on my (hastily set up) linux box, so I'm committing and will test on MacOS too. --- README | 11 ++++++++--- src/jalview/bin/Jalview.java | 8 +++++++- test/jalview/bin/CommandLineOperations.java | 8 +++++++- utils/InstallAnywhere/README_IA | 12 +++++++++--- 4 files changed, 31 insertions(+), 8 deletions(-) diff --git a/README b/README index 74f4591..8172066 100755 --- a/README +++ b/README @@ -21,13 +21,18 @@ For more help, read the file doc/building.html ################## -To run application: +To run application... +[ NOTE: when using the -classpath option with the '*' wildcard, the argument must be quoted to avoid shell expansion of the wildcard, + ALSO, the wildcard MUST be as DIR/* and not DIR/*.jar etc or it will not be interpreted correctly ] -java -classpath "JALVIEW_HOME/lib/*:JALVIEW_HOME/jalview.jar" jalview.bin.Jalview +on Windows use: + java -classpath "JALVIEW_HOME/lib/*;JALVIEW_HOME/jalview.jar" jalview.bin.Jalview +and on MacOS or Linux: + java -classpath "JALVIEW_HOME/lib/*:JALVIEW_HOME/jalview.jar" jalview.bin.Jalview Replace JALVIEW_HOME with the full path to Jalview Installation Directory. If building from source: -java -classpath "JALVIEW_BUILD/dist/*" jalview.bin.Jalview + java -classpath "JALVIEW_BUILD/dist/*" jalview.bin.Jalview ################## diff --git a/src/jalview/bin/Jalview.java b/src/jalview/bin/Jalview.java index 0b1cf60..adf3773 100755 --- a/src/jalview/bin/Jalview.java +++ b/src/jalview/bin/Jalview.java @@ -70,9 +70,15 @@ import groovy.util.GroovyScriptEngine; /** * Main class for Jalview Application
*
- * start with java -classpath "$PATH_TO_LIB$/*:$PATH_TO_CLASSES$" + * 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$ */ diff --git a/test/jalview/bin/CommandLineOperations.java b/test/jalview/bin/CommandLineOperations.java index 2b40a72..9b94be9 100644 --- a/test/jalview/bin/CommandLineOperations.java +++ b/test/jalview/bin/CommandLineOperations.java @@ -116,9 +116,15 @@ public class CommandLineOperations private Worker jalviewDesktopRunner(boolean withAwt, String cmd, int timeout) { + String cp_sep = ":"; + if (System.getProperty("os.name").indexOf("Windows") >= 0) + { + cp_sep = ";"; + } String _cmd = "java " + (withAwt ? "-Djava.awt.headless=true" : "") - + " -classpath \"./lib/*:./classes\" jalview.bin.Jalview "; + + " -classpath \"./lib/*" + cp_sep + + "./classes\" jalview.bin.Jalview "; System.out.println("CMD [" + cmd + "]"); Process ls2_proc = null; Worker worker = null; diff --git a/utils/InstallAnywhere/README_IA b/utils/InstallAnywhere/README_IA index 3ccb2a4..82062f9 100755 --- a/utils/InstallAnywhere/README_IA +++ b/utils/InstallAnywhere/README_IA @@ -13,12 +13,18 @@ Use -help to see the available command line arguments. For best results use a Sun java run time environment (not the gcj gnu java, sorry!). -If you want to the java runtime bundled with Jalview, then launch jalview like this: +If you want to use the java runtime bundled with Jalview, then launch jalview like this: +in Windows: +JAVA_HOME=JALVIEW_HOME/jre JALVIEW_HOME/jre/bin/java -classpath "JALVIEW_HOME/lib/*;JALVIEW_HOME/jalview.jar" jalview.bin.Jalview + +in Linux: JAVA_HOME=JALVIEW_HOME/jre JALVIEW_HOME/jre/bin/java -classpath "JALVIEW_HOME/lib/*:JALVIEW_HOME/jalview.jar" jalview.bin.Jalview -[or + +in macOS: JAVA_HOME=JALVIEW_HOME/jre/Contents/Home JALVIEW_HOME/jre/Contents/Home/bin/java -classpath "JALVIEW_HOME/lib/*:JALVIEW_HOME/jalview.jar" jalview.bin.Jalview -in macOS] + +Note: ensure the -classpath argument is quoted and only use a terminating wildcard (e.g. 'DIR/*') to refer to all jar files in a directory, don't use e.g. 'DIR/*.jar' ################## -- 1.7.10.2