import org.testng.annotations.Test;
import io.github.classgraph.ClassGraph;
+import io.github.classgraph.ModuleRef;
import io.github.classgraph.ScanResult;
public class CommandLineOperations
private static String classpath = null;
+ private static String modules = null;
+
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());
+ }
}
while (classpath == null)
{
// not expanded by the shell
String classpath = getClassPath();
String _cmd = "java " + (withAwt ? "-Djava.awt.headless=true" : "")
- + " -classpath " + classpath + " jalview.bin.Jalview ";
+ + " -classpath " + classpath
+ + (modules.length() > 2 ? "--add-modules=\"" + modules + "\""
+ : "")
+ + " jalview.bin.Jalview ";
Process ls2_proc = null;
Worker worker = null;
try