Fix - Java: invalid source release: IntelliJ IDE


java invalid source release

If you see an error like "java: invalid source release" when you run a Java class in IntelliJ IDE then follow the below steps to fix this issue.

  1. Right Click on your Project/Module folder.
  2. Now select "Open Module Settings..."
  3. Next click on Project under Project Settings.
  4. Make sure that Langauge Level is lower or equal to the SDK (Java JDK) version you have selected.
  5. Language level IntelliJ Project

    For example, if you have set the SDK version as Java 1.8, you should select Language level as 1.8 or below and not Java 9 or higher.

  6. Click OK.
  7. Run your Java program again and it should work without any issues.

This is not an AI-generated article but is demonstrated by a human with IDEA IntelliJ 2023.02 version on a M1 Mac running macOS Sonoma 14.0.

Please support independent contributors like Code2care by donating a coffee.
Buy me a coffee!

Buy Code2care a Coffee!

Facing issues? Have Questions? Post them here! I am happy to answer!

Author Info:

Rakesh (He/Him) has over 14+ years of experience in Web and Application development. He is the author of insightful How-To articles for Code2care.

Follow him on: X

You can also reach out to him via e-mail: rakesh@code2care.org

Copyright © Code2care 2024 | Privacy Policy | About Us | Contact Us | Sitemap