EN
IntelliJ - Groovy compilation error
1
answers
7
points
When I try build my Groovy project in IntelliJ IDEA Community Edition I get following error:
Groovyc: Internal groovyc error: code 1
Detailed error:
Executing pre-compile tasks...
Loading Ant Configuration...
Running Ant Tasks...
Internal caches are corrupted or have outdated format, forcing project rebuild: backward reference index will be updated to actual version
Cleaning output directories...
Running 'before' tasks
Checking sources
Copying resources... [e2e-ui]
Groovyc: loading sources... [tests of e2e-ui]
Groovy compiler in operation... [tests of e2e-ui]
Groovyc: While compiling tests of e2e-ui:java.lang.NoClassDefFoundError: Could not initialize class org.codehaus.groovy.classgen.Verifier
at org.codehaus.groovy.control.CompilationUnit.<init>(CompilationUnit.java:169)
at org.jetbrains.groovy.compiler.rt.DependentGroovycRunner$2.<init>(DependentGroovycRunner.java:368)
at org.jetbrains.groovy.compiler.rt.DependentGroovycRunner.createCompilationUnit(DependentGroovycRunner.java:368)
at org.jetbrains.groovy.compiler.rt.DependentGroovycRunner.runGroovyc(DependentGroovycRunner.java:102)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:564)
at org.jetbrains.groovy.compiler.rt.GroovycRunner.intMain2(GroovycRunner.java:81)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:564)
at org.jetbrains.jps.incremental.groovy.InProcessGroovyc.runGroovycInThisProcess(InProcessGroovyc.java:167)
at org.jetbrains.jps.incremental.groovy.InProcessGroovyc.lambda$runGroovyc$0(InProcessGroovyc.java:77)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630)
at java.base/java.lang.Thread.run(Thread.java:832)
Groovyc: Internal groovyc error: code 1
Finished, saving caches...
Executing post-compile tasks...
Loading Ant Configuration...
Running Ant Tasks...
Synchronizing output directories...
09.10.2020, 14:47 - Build completed with 1 error and 0 warnings in 1 s 888 ms
Screenshot:
How to solve it ?
1 answer
3
points
I had the same problem on my Ubuntu 20.04.
It was caused by an incorrect Java version. So, try to change to Java 13.
Now, I have set JAVA_HOME
env variable to local installation directory:
/home/greg/.jdks/azul-13.0.4
Note: JDK azul-13.0.4 was installed automatically by IntelliJ IDEA, so check your installation path.
You can set JAVA_HOME
in ~/.profile
file. Just put at file beginning:
export JAVA_HOME="/home/greg/.jdks/azul-13.0.4"
export PATH=$PATH:$JAVA_HOME/bin:$HOME/bin
Note: do not forget to logout and login or restart your operating system.
0 comments
Add comment