Errors when running my WEKA classifier on all images in a folder

I have trained a classifier to segment tight junctions from brain blood vessels, I now want to apply it to folders containing ~20 images per folder.

I have used the script here to run the classifier, but when I try to run it I get the following errors which cause the script to exit.

In the console:
- WARNING: core mtj jar files are not available as resources to this classloader *
(sun.misc.Launcher$AppClassLoader@c387f44)

-Exception in thread “Thread-14” java.lang.OutOfMemoryError: Java heap space

in the window at the bottom of the macro editor:
- Target exception: java.lang.NullPointerException

Can anyone help me work out what’s gone wrong?