Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

gradle compileJava error java.lang.StackOverflowError

I am trying run gradle project, every task which included javaCompile fails. I getting

The system is out of resources.
Consult the following stack trace for details.
java.lang.StackOverflowError
at com.sun.tools.javac.code.Type.map(Type.java:220)
at com.sun.tools.javac.code.Type.map(Type.java:220)
at com.sun.tools.javac.code.Type.map(Type.java:220)
at com.sun.tools.javac.code.Type.map(Type.java:220)
.........

Run on Ubuntu 17.04, oracle java 1.8.0_144-b01, gradle -v

Gradle 4.0.2
Build time:   2017-07-26 15:04:56 UTC
Revision:     108c593aa7b43852f39045337ee84ee1d87c87fd
Groovy:       2.4.11
Ant:          Apache Ant(TM) version 1.9.6 compiled on June 29 2015
JVM:          1.8.0_144 (Oracle Corporation 25.144-b01)
OS:           Linux 4.10.0-30-generic amd64      

I trying several versions of gradle, jdk9, jvmargs like

compileJava {
options.fork = true
options.forkOptions.jvmArgs += ["-Xms2048m", "-Xmx4096m","-XX:ReservedCodeCacheSize=1024m", "-XX:+UseCompressedOops"]}

Thanks for your help.

like image 519
maldanus Avatar asked Jul 22 '26 09:07

maldanus


1 Answers

You are hitting with one of the known issue in java JDK-8077306 This has been already fixed in jdk9. Upgrading to jdk9 could resolve this issue.

As this is not backported to 8, so you cannot make any workaround in 8.

like image 157
Fairoz Avatar answered Jul 23 '26 23:07

Fairoz



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!