本文介绍了尝试在IntelliJ中构建项目时发生同步错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试在IntelliJ中构建我的第一个helloWorld程序时遇到以下同步错误.

Getting the following sync error while trying to build my first helloWorld program in IntelliJ.

我是在运行Windows 10的计算机上首次安装IntelliJ.

I've installed IntelliJ for the first time on my computer running Windows 10.

    Could not open init generic class cache for initialization script 'C:\Users\nikhils\AppData\Local\Temp\wrapper_init5.gradle' (C:\Users\nikhils\.gradle\caches\6.6.1\scripts\2xaig2b083uxqwleg0fdntova).
> BUG! exception in phase 'semantic analysis' in source unit '_BuildScript_' Unsupported class file major version 60

推荐答案

将项目和Gradle JDK更改为受支持的版本(8-15).当前的Gradle发布版本不支持Java16.如果要使用Java 16,则需要Gradle 7.

Change project and Gradle JDK to the supported version (8—15). Current Gradle release versions do not support Java 16. You would need Gradle 7 if you want to use Java 16.

最简单的方法是使用Java 11创建一个新项目.

The easiest way would be to create a new project with Java 11.

还要注意,从IntelliJ IDEA 2021.1版本(当前发行版本为2020.3.3)开始,将完全支持Java 16.

Also note that full Java 16 support will be available starting from IntelliJ IDEA 2021.1 release (current release version is 2020.3.3).

请参见 https://www.jetbrains.com/idea/nextversion/您想尝试一下.

这篇关于尝试在IntelliJ中构建项目时发生同步错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-23 08:15