NiCk Sharma
NiCk Sharma

Reputation: 41

Sync error while trying to build project in IntelliJ

Getting the following sync error while trying to build my first helloWorld program in 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

Upvotes: 4

Views: 4823

Answers (1)

CrazyCoder
CrazyCoder

Reputation: 401975

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.

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

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

See https://www.jetbrains.com/idea/nextversion/ if you want to give it a try.

Upvotes: 8

Related Questions