Class file version problem on Java 17

Jochen Wiedmann <[email protected]>
Newsgroups gmane.comp.lang.groovy.user
Message-ID <CAF8HOZLA_p9KEuf6iwcHZ-oq4ivLQ7cKOsr62U+wU==owKZhOw@mail.gmail.com>
Hi,

I've got a Groovy script (4.0.0-beta-2), which is embedded into a Java
program. When unit testing the program on Java 8, everything is
working fine. However, if I do run the same unit test on Java 17, I
get the stack trace below.

Is there anything, I need to adjust when using Java 17? I am thinking
along the line of setting a target version in the GroovyShell, or the
like.

Thanks,

Jochen

BUG! exception in phase 'semantic analysis' in source unit
'file:/C:/Windows/System32/config/systemprofile/AppData/Local/Jenkins/.jenkins/workspace/afw-17/afw-core/target/test-classes/com/github/jochenw/afw/core/scripts/simple-script.groovy'
Unsupported class file major version 61
at org.codehaus.groovy.control.CompilationUnit$ISourceUnitOperation.doPhaseOperation(CompilationUnit.java:905)
at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:627)
at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:367)
at groovy.lang.GroovyClassLoader.lambda$parseClass$2(GroovyClassLoader.java:310)
at org.codehaus.groovy.runtime.memoize.StampedCommonCache.compute(StampedCommonCache.java:163)
at org.codehaus.groovy.runtime.memoize.StampedCommonCache.getAndPut(StampedCommonCache.java:154)
at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:308)
at groovy.lang.GroovyShell.parseClass(GroovyShell.java:526)
at groovy.lang.GroovyShell.parse(GroovyShell.java:538)
at groovy.lang.GroovyShell.parse(GroovyShell.java:518)



-- 
Philosophy is useless, theology is worse. (Industrial Desease, Dire Straits)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.