我的Gradle Java项目为什么在IntelliJ中无法构建?

huangapple go评论65阅读模式
英文:

Why my Gradle Java project doesn't build in Intellij?

问题

我正在尝试在IntelliJ中启动我的Java Gradle项目。

我已经将我的Tomcat配置与我的同事配置成相同。

他们的项目构建正常。

当我开始构建时,我在构建选项卡中看到以下内容。

我的Gradle Java项目为什么在IntelliJ中无法构建?

它无法继续执行Writing classes这一步。

我的应用程序中没有任何ant任务。我只使用Gradle进行依赖管理。但由于某种原因,IntelliJ会运行一些Ant任务并尝试“写入”一些类。

在此之后,构建过程会挂起,大约3分钟后会出现内存异常。奇怪的是,只有我的项目会出现这种失败情况,我其他同事的项目都能正常工作。

有时候,我不会收到内存异常。但我会收到以下异常。

java: 编译失败:内部Java编译器错误

请告诉我您需要解决此问题所需的任何信息。

我使用的是Java 1.8,Gradle 5.6.2,IntelliJ 2020.2 Ultimate(最新版)。

提前感谢您。

英文:

I'm trying to start my Java Gradle project in IntelliJ.

I have configured my Tomcat configurations as same as my colleagues.

Their project builds fine.

When I start the build I see the following in the build tab.

我的Gradle Java项目为什么在IntelliJ中无法构建?

It doesn't go beyond the Writing classes part.

I don't have any ant tasks in my application. I use only Gradle for dependency management. But for some reason, IntelliJ runs some Ant tasks and tries to 'Write' some classes.

The build hangs after this and a Memory Exception occurs after about 3 minutes. Thing is only my project that fails like this. My other colleague's projects work.

Sometimes, I don't get the memory exception. But I get the following exception.

java: Compilation failed: internal java compiler error

Please let me know any information you need to resolve this issue.

I'm using Java 1.8, Gradle 5.6.2, IntelliJ 2020.2 Ultimate ( The latest )

Thanks in advance

答案1

得分: 1

我通过将编译器设置中的构建进程堆大小增加到2000(默认值为700),来解决了这个问题,如下图所示。

我的Gradle Java项目为什么在IntelliJ中无法构建?

英文:

I solved the issue by increasing the Build process heap size in the Compiler settings to 2000 ( The default value is 700 ) as in the following picture.

我的Gradle Java项目为什么在IntelliJ中无法构建?

huangapple
  • 本文由 发表于 2020年9月12日 11:31:37
  • 转载请务必保留本文链接:https://go.coder-hub.com/63856555.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定