gradle compileJava error java.lang.StackOverflowError

Viewed 2463

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.

1 Answers
Related