Problem with groovy buffer chalange at commandline

I am trying to do the groovy at the command line. I am showing my info in cmd.exe and powershell but I am also having problem in WSL.

On Windows I am wrunning the following and got the following errors. I also tried with jdk 17 and groovy 2.4 on linux and got different errors. Can some one add to the help.md and maybe answer hhere what groovy and what jdk this is running with for whoever wrote this track? Here is what I am using.

Groovy 4.0
Java 21

Oh I have had to concat the message here because it is limited to 7k this was 16k
Here is what errrors I am getting currently at the commandline but I am not having much luck at Linux either. Maybe if I knew the versions the gradlew is setup with I could get this going.

Starting a Gradle Daemon, 1 incompatible and 1 stopped Daemons could not be reused, use --status for details
java.lang.NoClassDefFoundError: Could not initialize class org.codehaus.groovy.vmplugin.v7.Java7
at org.codehaus.groovy.vmplugin.VMPluginFactory.(VMPluginFactory.java:43)
at org.codehaus.groovy.reflection.GroovyClassValueFactory.(GroovyClassValueFactory.java:35)
at org.codehaus.groovy.reflection.ClassInfo.(ClassInfo.java:107)
at org.codehaus.groovy.reflection.ReflectionCache.getCachedClass(ReflectionCache.java:95)
at org.codehaus.groovy.reflection.ReflectionCache.(ReflectionCache.java:39)
at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.registerMethods(MetaClassRegistryImpl.java:210)
at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.(MetaClassRegistryImpl.java:108)
at org.cod

I wonder if the Groovy version that Gradle is picking up is too old - the version listed in build.gradle is 3.0.2. To test this, could you please try updating the exercise’s build.gradle file and change the bit inside the dependencies section to this:

    testImplementation "org.spockframework:spock-core:2.4-M2-groovy-4.0"
    implementation "org.apache.groovy:groovy-all:4.0.19"
1 Like

After you pointed out that it was on version 3.0 of Groovy. I am sorry I missed that. I tried using my version of groovy which is 4.0.9 and I got errors. Using jdk 21. Just to see what would happen. I switched to groovy 3.0.21 and Open jdk 1.8. (old and should not be used.). Everything worked perfectly. I wish people would not use JDK’s that old. I happen to have it on my system because of old software that we maintain but do not upgrade. I guess this needs to be put in the help.md notes to use groovy 3.0.21 and jdk 1.8 for Windows.

Thanks for your help. I can at least do the chalange now.

All of our tracks are volunteer-maintained, but the Groovy track is currently unmaintained and a little stale as you found out. If you’re interested in helping us upgrade to v4.0, the Exercism community will appreciate the effort.

1 Like

I am not a gradle expert. If you tell me what repo needs updating for groovyI can take a look. Iam kind of a swiss army knife coder so I might be able to help. I notice there are a lot of them to go through.

1 Like