简体   繁体   中英

Error:BUG! exception in phase 'class generation' in source unit '_BuildScript_' unsupported Target MODULE

I'm trying to create a new Java 9 project using gradle but right after project creation I received error from gradle:

Error:BUG! exception in phase 'class generation' in source unit '_BuildScript_' unsupported Target MODULE

Java version: 9 (build 9+178)
Gradle version: 4.1-rc-2

According to this article those java/gradle versions should be compatible.
How can I solve this problem?

Any help highly appreciated.

I have solved it by downgrading Gradle JVM to 8. It is not perfect but keeps you going while jdk9 and gradle and intellij stabilises.

Intellij View

Setting the Gradle home to local Gradle distribution solved the issue in my case.

  • Java version: 9+181
  • Gradle version: 4.1
  • Intellij version: 2017.2.2

if we set to use default Gradle wrapper, IntelliJ downloads an earlier version of Gradle. I think it is the reason for failure.

在此输入图像描述

这个问题似乎已在 Groovy 2.4.12 中修复,升级到至少该版本解决了https://github.com/jenkinsci/JenkinsPipelineUnit/issues/292 中的类似问题。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM