Problem using Lemur

I recently tried using lemur but when I try to load the glass style I get an exception

java.lang.NoClassDefFoundError: groovy/lang/Binding
	at org.codehaus.groovy.jsr223.GroovyScriptEngineFactory.getScriptEngine(GroovyScriptEngineFactory.java:104)
	at java.scripting/javax.script.ScriptEngineManager.lambda$getEngineBy$2(ScriptEngineManager.java:237)
	at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197)
	at java.base/java.util.stream.StreamSpliterators$WrappingSpliterator.tryAdvance(StreamSpliterators.java:300)
	at java.base/java.util.stream.Streams$ConcatSpliterator.tryAdvance(Streams.java:723)
	at java.base/java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:129)
	at java.base/java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:527)
	at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:513)
	at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499)
	at java.base/java.util.stream.FindOps$FindOp.evaluateSequential(FindOps.java:150)
	at java.base/java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.base/java.util.stream.ReferencePipeline.findFirst(ReferencePipeline.java:647)
	at java.scripting/javax.script.ScriptEngineManager.getEngineBy(ScriptEngineManager.java:246)
	at java.scripting/javax.script.ScriptEngineManager.getEngineByName(ScriptEngineManager.java:185)
	at com.simsilica.lemur.style.StyleLoader.<init>(StyleLoader.java:73)
	at com.simsilica.lemur.style.StyleLoader.<init>(StyleLoader.java:62)
	at com.simsilica.lemur.style.BaseStyles.loadStyleResources(BaseStyles.java:72)
	at com.simsilica.lemur.style.BaseStyles.loadGlassStyle(BaseStyles.java:62)
	at mygame.Main.simpleInitApp(Main.java:112)
	at com.jme3.app.SimpleApplication.initialize(SimpleApplication.java:239)
	at com.jme3.system.lwjgl.LwjglAbstractDisplay.initInThread(LwjglAbstractDisplay.java:130)
	at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:211)
	at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: java.lang.ClassNotFoundException: groovy.lang.Binding
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520)
	... 23 more
1 Like

Do you have groovy-jsr223.jar in the dependencies?

yeah I think so

I have groovy-jsr223-2.1.9.jar

“have” how?

Be sure that it was groovy-jsr223-2.1.9.jar and not groovy-jsr223-2.1.9.zip.

There is a big difference.

How what…?

How do you “have” groovy? You are sitting on it. You put it on the disk somewhere. You referenced it in a build.gradle file?

We are left to guess… and only one of the ways is the way that will work properly.

I put it as a library in IntelliJ

I don’t know if that approach is going to download all of groovy-jsr223-2.1.9.jar's dependencies.

And now that I say it it feels ridiculous

So what would be the right way?

I will let others who use an IDE comment. I just add the dependencies to my build.gradle file and let it work it out. Presumably Intelli-j has a similar mechanism.

Sounds like Ant…? Maybe this would be a good point to start using Gradle.

So instead of adding the jars you use gradle