Programming has become a lot easier than it used to be thanks to the internet and the hundreds of thousands of online resources readily available to developers around the world. However, random bugs and glitches are still very much part of the development process and can show up out of nowhere to surprise you.
In this article, we’re talking about the Java: Error: Release version 17 not supported error, its causes and what you can do to fix the problem.
What cause the Java: Error: Release version 17 not supported error?
As the error message suggests, the Java compiler is trying to use release version 17 to compile your project but the project in question either doesn’t support it or you don’t have an active version 17 installation for the compiler to use. The issue can be resolved by either changing your project settings or specifying which Java version needs to be used.
Also read: How to fix ‘Java: compilation failed: internal java compiler error’?
How to fix the Java: Error: Release version 17 not supported error?
Here are three fixes you can try out.
Update Java compiler settings
The error often happens in IntelliJ after a Java version update. All you have to do is head over to IntelliJ settings, followed by Java Compiler settings. Once there, make sure that the Project bytecode version is set to the preferred Java version or in this case, version 17. Restart your IDE and you should be good to go.
Updating your JDK version can also help get rid of uncalled-for compilation issues. Head over to Oracle’s JDK download page and download the x64 installer for the latest JDK version. Install the downloaded installer once the download is complete.
You can check out our detailed guide on how to install Java on Windows here and Linux here.
If nothing else works, you will have to remove Java from your PC and reinstall it again to iron out any issues.
Step 1: Press Windows key + X to bring up the quick access menu. Select Apps and Features from this menu.
Step 2: Find Java in the list, click on it and select Uninstall.
Once the uninstaller is complete, you can download Java and reinstall it to fix the problem.
Check out our detailed guide on how to install Java in Windows here
Also read: Fix: Java.lang.outofmemoryerror: gc overhead limit exceeded