QUEx on QuPath2.0

I was using QuPath 1.2 until 4 hours ago. And I updated to QuPath 2.0 few hours ago.

A groovy script which was normally operated on the previous version without error is not worked in QuPath 2.0.
As shown in the error report, I think that the editor cannot import QPEx library.

To update the version of QuPath, I uninstalled previous version first and then re-installed the new version on the same path.

My OS is windows 10 (64 bit) and reported error is as follows:

ERROR: Error: startup failed:
Script1.groovy: 16: unable to resolve class qupath.lib.scripting.QPEx
 @ line 16, column 1.
   import qupath.lib.scripting.QPEx
   ^

1 error


ERROR: Script error
    at org.codehaus.groovy.control.ErrorCollector.failIfErrors(ErrorCollector.java:311)
    at org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(CompilationUnit.java:980)
    at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:647)
    at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:596)
    at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:390)
    at groovy.lang.GroovyClassLoader.access$300(GroovyClassLoader.java:89)
    at groovy.lang.GroovyClassLoader$5.provide(GroovyClassLoader.java:330)
    at groovy.lang.GroovyClassLoader$5.provide(GroovyClassLoader.java:327)
    at org.codehaus.groovy.runtime.memoize.ConcurrentCommonCache.getAndPut(ConcurrentCommonCache.java:147)
    at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:325)
    at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:309)
    at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:251)
    at org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.getScriptClass(GroovyScriptEngineImpl.java:331)
    at org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.eval(GroovyScriptEngineImpl.java:153)
    at qupath.lib.gui.scripting.DefaultScriptEditor.executeScript(DefaultScriptEditor.java:766)
    at qupath.lib.gui.scripting.DefaultScriptEditor.executeScript(DefaultScriptEditor.java:696)
    at qupath.lib.gui.scripting.DefaultScriptEditor.executeScript(DefaultScriptEditor.java:676)
    at qupath.lib.gui.scripting.DefaultScriptEditor$2.run(DefaultScriptEditor.java:1033)
    at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    at java.base/java.lang.Thread.run(Thread.java:834)
1 Like

I’m afraid this is a change needed to adapt to the new module system in Java 11… try either just removing

import qupath.lib.scripting.QPEx

or replacing it with

import qupath.lib.gui.scripting.QPEx
6 Likes

Thanks Pete,

It is working!!
I replaced “import qupath.lib.scripting.QPEx” to “import qupath.lib.gui.scripting.QPEx”.

1 Like