allow groovy scripts to be run when in headless mode - pass startupAlFrame as context
[jalview.git] / src / jalview / bin / Jalview.java
index ba2d3bd..80f3722 100755 (executable)
@@ -670,7 +670,7 @@ public class Jalview
        * = new Binding(); binding.setVariable("input", "world");
        * gse.run("hello.groovy", binding); </code>
        */
-      ClassLoader cl = jalviewContext.getClass().getClassLoader();
+      ClassLoader cl = (jalviewContext[0]!=null ? jalviewContext[0] : jalviewContext[1]).getClass().getClassLoader();
       Class gbindingc = cl.loadClass("groovy.lang.Binding");
       Constructor gbcons = gbindingc.getConstructor(null);
       Object gbinding = gbcons.newInstance(null);