Import groovy packages

Tags: #<Tag:0x00007fb88274a828> #<Tag:0x00007fb88274a4e0>



I am trying to import the XmlSlurper that is packaged in Groovy from within Fiji

import groovy.util.XmlSlurper

However this leads to

org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
Script9.groovy: 4: unable to resolve class groovy.util.XmlSlurper
 @ line 4, column 1.
   import groovy.util.XmlSlurper

I have Groovy installed (for a Windows machine) and the GROOVY_PATH and PATH variables contain where Groovy is installed.

Is there something I am missing to get it to work from within ImageJ?



ImgLib2 Virtual Stack of multiple images

Using Plugins > Utilities > Find Jar For Class with groovy.util.XmlSlurper, I get:

The class groovy.util.XmlSlurper was not found in ImageJ’s class path

Searching on, you can see that the class is in the groovy-xml artifact that you’ll have to put on your Fiji class path (i.e. copy it into ./ in order to use it.;classname~groovy.util.XmlSlurper


Wonderful, thank you very much for the help and explanation!