Looks like when creating the "Groovy Script" run configuration, the main class is set to org.codehaus.groovy.tools.GroovyStarter
instead of the script you are intending to run. Replacing it with the Groovy class/script you would like to run sorts the issue.
Update
After some digging the way to solve the issue is:
- Remove the Groovy dependency from the Gradle build.
- Configure the project classpath and nature, as suggested in this answer
build.gradle
eclipse {
project {
natures.add 'org.eclipse.jdt.groovy.core.groovyNature'
}
classpath {
file {
withXml {
Node node = it.asNode()
node.appendNode('classpathentry',[exported:"true",kind:"con",path:"GROOVY_SUPPORT"])
node.appendNode('classpathentry',[exported:"true",kind:"con",path:"GROOVY_DSL_SUPPORT"])
}
}
}
}