error while building project on java 17
Hi.
I am trying to build a project that uses java 17.
Teamcity and the agent are on the same system where Java 11 is installed. I tried to run Build, but got an error:
java.lang.IllegalArgumentException: No enum constant org.jetbrains.jps.model.java.LanguageLevel.JDK_17
I installed Java 17 and in the project settings I did as in the screenshot.

Then I got an error:
Ant output
15:11:03 java.lang.reflect.InvocationTargetException
15:11:03 at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
15:11:03 at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
15:11:03 at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
15:11:03 at java.base/java.lang.reflect.Method.invoke(Method.java:568)
15:11:03 at org.codehaus.groovy.tools.GroovyStarter.rootLoader(GroovyStarter.java:109)
15:11:03 at org.codehaus.groovy.tools.GroovyStarter.main(GroovyStarter.java:131)
15:11:03 at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
15:11:03 at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
15:11:03 at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
15:11:03 at java.base/java.lang.reflect.Method.invoke(Method.java:568)
15:11:03 at jetbrains.buildServer.agent.ideaRunner.ToolsAwareGroovyStarter.main(ToolsAwareGroovyStarter.java:48)
15:11:03 Caused by: groovy.lang.MissingMethodException: No signature of method: org.codehaus.groovy.tools.RootLoader.getPackage() is applicable for argument types: (java.lang.String) values: [gant]
15:11:03 at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:58)
15:11:03 at org.codehaus.groovy.runtime.callsite.PojoMetaClassSite.call(PojoMetaClassSite.java:49)
15:11:03 at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
15:11:03 at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
15:11:03 at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
15:11:03 at gant.Gant.<init>(Gant.groovy:192)
15:11:03 at gant.Gant.<init>(Gant.groovy:180)
15:11:03 at gant.Gant.<init>(Gant.groovy:173)
15:11:03 at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
15:11:03 at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77)
15:11:03 at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
15:11:03 at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)
15:11:03 at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:480)
15:11:03 at org.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:83)
15:11:03 at org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrapNoCoerce.callConstructor(ConstructorSite.java:105)
15:11:03 at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:60)
15:11:03 at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:235)
15:11:03 at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:239)
I tried different configuration options and did a lot of things, but the answers in Google did not help me.
Maybe someone can help with advice. Thank you.
Please sign in to leave a comment.
Hello Roman,
This issue seems to be the same as the following youtrack issue:
https://youtrack.jetbrains.com/issue/TW-71108
In order to us to replicate and investigate this issue further on our side, which Java 17 distribution and Groovy version are you using for this project?
Meanwhile, we suggest that you follow and vote for the youtrack item above.
Thank you,
Guilherme