import org.testng.annotations.Test;
import io.github.classgraph.ClassGraph;
+import io.github.classgraph.ModuleRef;
+import io.github.classgraph.ScanResult;
import jalview.gui.JvOptionPane;
public class CommandLineOperationsNG
public synchronized static String getClassPath()
{
- // if (scanner == null)
- // {
- // scanner = new ClassGraph();
- // ScanResult scan = scanner.scan();
- // classpath = scan.getClasspath();
- modules = "";
- // for (ModuleRef mr : scan.getModules())
- // {
- // modules.concat(mr.getName());
- // }
- java_exe = System.getProperty("java.home") + File.separator + "bin"
- + File.separator + "java";
-
- // }
-
- // while (classpath == null)
- // {
- // try
- // {
- // Thread.sleep(10);
- // } catch (InterruptedException x)
- // {
- //
- // }
- // }
+ if (scanner == null)
+ {
+ scanner = new ClassGraph();
+ ScanResult scan = scanner.scan();
+ classpath = scan.getClasspath();
+ modules = "";
+ for (ModuleRef mr : scan.getModules())
+ {
+ modules.concat(mr.getName());
+ }
+ java_exe = System.getProperty("java.home") + File.separator + "bin"
+ + File.separator + "java";
+
+ }
+
+ while (classpath == null)
+ {
+ try
+ {
+ Thread.sleep(10);
+ } catch (InterruptedException x)
+ {
+
+ }
+ }
return classpath;
}
private Worker getJalviewDesktopRunner(boolean withAwt, String cmd,
int timeout)
{
- // Note: JAL-3065 - don't include quotes for lib/* because the arguments are
- // not expanded by the shell
- // String classpath = getClassPath();
- getClassPath();
+ /*
boolean win = System.getProperty("os.name").indexOf("Win") >= 0;
String pwd = "";
try
String[] classpaths = new String[] { pwd + "/bin/main",
pwd + "/j11lib/*", pwd + "/resources", pwd + "/help" };
String classpath = String.join(win ? ";" : ":", classpaths);
+ getClassPath();
+ */
+ // Note: JAL-3065 - don't include quotes for lib/* because the arguments are
+ // not expanded by the shell
+ String classpath = getClassPath();
String _cmd = java_exe + " "
+ (withAwt ? "-Djava.awt.headless=true" : "") + " -classpath "
+ classpath