Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

java: error: release version 17 not supported

I recently updated to Intellij 2021.1. However, whenever I try to run my program, I get:

java: error: release version 17 not supported

I have tried snooping around for other answers, and have found none. It appears my sdk is version 16, if that helps.

like image 808
Smatt14 Avatar asked Apr 14 '21 20:04

Smatt14


2 Answers

This issue happened to me while upgrading to Java 17, I solved it by configuring the new SDK in project structure and invalidate the caches : File --> invalidate caches --> default selection and restart.

like image 133
Radi Avatar answered Oct 09 '22 12:10

Radi


Your error is likely from IntelliJ attempting to call a Java 17 parser for compliance with Java 17 syntax (regardless of the SDK type) and there is no Java 17 JDK installed to perform the syntax checking with. You have 2 options.

Change 'Language Level' (Project Settings / Project in the Module Settings available from context window - right click - in the project window) to match your current SDK (ignoring possible language conflicts with more recent versions)

Download a Java 17 JDK to perform parsing with. That is in Platform Settings/SDKs in the same context menu, select '+', select 'Download JDK', then download and install a Java 17 version.

like image 23
Daniel McEnnis Avatar answered Oct 09 '22 13:10

Daniel McEnnis