[Redis] Can't run initial code due to Java config

I am facing run issues as with the error

Error: LinkageError occurred while loading main class MainKtjava.lang.UnsupportedClassVersionError: MainKt has been compiled by a more recent version of the Java Runtime (class file version 65.0), this version of the Java Runtime only recognizes class file versions up to 61.0

I have tried to change JRE for Maven as its currently 21 but still same issue.

Hey @imAtulSharma, could you upload your code to GitHub and share the link?

Alternatively, a screenshot of the changes you made would work too.

Sure here are the screenshot

Could you try the following?

  1. Go to File → Project Structure → Project Settings → Project
  2. Set the Project SDK to Java 21
  3. Ensure the Module SDK is also set to Java 21

Yes… now it worked… thank you very much.

1 Like

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.