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:
xxxxxxxxxx
1
Groovyc: Internal groovyc error: code 1
Detailed error:
xxxxxxxxxx
1
Executing pre-compile tasks...
2
Loading Ant Configuration...
3
Running Ant Tasks...
4
Internal caches are corrupted or have outdated format, forcing project rebuild: backward reference index will be updated to actual version
5
Cleaning output directories...
6
Running 'before' tasks
7
Checking sources
8
Copying resources... [e2e-ui]
9
Groovyc: loading sources... [tests of e2e-ui]
10
Groovy compiler in operation... [tests of e2e-ui]
11
Groovyc: While compiling tests of e2e-ui:java.lang.NoClassDefFoundError: Could not initialize class org.codehaus.groovy.classgen.Verifier
12
at org.codehaus.groovy.control.CompilationUnit.<init>(CompilationUnit.java:169)
13
at org.jetbrains.groovy.compiler.rt.DependentGroovycRunner$2.<init>(DependentGroovycRunner.java:368)
14
at org.jetbrains.groovy.compiler.rt.DependentGroovycRunner.createCompilationUnit(DependentGroovycRunner.java:368)
15
at org.jetbrains.groovy.compiler.rt.DependentGroovycRunner.runGroovyc(DependentGroovycRunner.java:102)
16
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
17
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
18
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
19
at java.base/java.lang.reflect.Method.invoke(Method.java:564)
20
at org.jetbrains.groovy.compiler.rt.GroovycRunner.intMain2(GroovycRunner.java:81)
21
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
22
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
23
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
24
at java.base/java.lang.reflect.Method.invoke(Method.java:564)
25
at org.jetbrains.jps.incremental.groovy.InProcessGroovyc.runGroovycInThisProcess(InProcessGroovyc.java:167)
26
at org.jetbrains.jps.incremental.groovy.InProcessGroovyc.lambda$runGroovyc$0(InProcessGroovyc.java:77)
27
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
28
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
29
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630)
30
at java.base/java.lang.Thread.run(Thread.java:832)
31
32
Groovyc: Internal groovyc error: code 1
33
Finished, saving caches...
34
Executing post-compile tasks...
35
Loading Ant Configuration...
36
Running Ant Tasks...
37
Synchronizing output directories...
38
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:
xxxxxxxxxx
1
/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:
xxxxxxxxxx
1
export JAVA_HOME="/home/greg/.jdks/azul-13.0.4"
2
export PATH=$PATH:$JAVA_HOME/bin:$HOME/bin
Note: do not forget to logout and login or restart your operating system.
0 commentsShow commentsAdd comment