Software⏱️ 2 min read📅 2026-05-31

How to Fix: Error:java: javacTask: source release 8 requires target release 1.8

IntelliJ IDE compilation error due to JDK and project settings mismatch.

Quick Answer: Update the project SDK and language level to match the used JDK version (Java 8).

The error message 'java: javacTask: source release 8 requires target release 1.8' is caused by a mismatch between the Java version used for compiling and the Java version used for running the project.

🔍 Why This Happens

  • The IntelliJ IDE is set to use Java 8 for compilation, but the project's target release is also set to Java 8.

🔧 Proven Troubleshooting Steps

Method 1: Update Project SDK

  1. Step 1: Go to the 'Project Structure' window and update the 'SDK' field to a compatible version, such as Java 11 or higher.

Method 2: Change Language Level

  1. Step 1: Go to the 'Language Levels' settings and change the language level to a compatible version, such as Java 11 or higher.

💡 Conclusion

By updating the project's SDK and/or changing the language level to a compatible version, you should be able to resolve the error and compile your project successfully.

Did this fix your problem?

If not, try searching for specific error codes.

🔍 Search Error Database

❓ Frequently Asked Questions