4

I got the error while building.

enter image description here

1
  • You are using JDK 1.8 and trying to use language level 18, go to the project settings and change it to 8. Commented Apr 28, 2022 at 8:13

1 Answer 1

10

Your project uses java 8 (denoted by 1.8) but your IDE is having Java 18. Upgrade your project to java 18 or change settings in your IDE to Java 8

Sign up to request clarification or add additional context in comments.

1 Comment

My project is based on Java 18 so I installed Java SDK 18 then setting up File | Project Structure | Platform Settings | SDKs | + | Detected SDKs: [sdk 18], Project Settings | Project | SDK: 18, Language level: SDK default (18 - No new language features); Project Settings | Modules | Sources: Project default (18 - No new language features). It worked. Thanks

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.