Why IDEA Fails to Start a Java Project with “error: java: invalid source release: 10”
The article explains that the “invalid source release: 10” error occurs because the IDE is set to JDK 10 while the system JDK is 8, and it walks through checking the JDK version and aligning IDEA project, compiler, and pom.xml settings to resolve the issue.
Problem Background
After creating a new project, attempting to run it in IntelliJ IDEA produces the console error error: java: invalid source release: 10. The author identifies this as a JDK version mismatch problem.
Analysis
The machine has JDK 8 installed, but the IDEA project configuration points to JDK 10, which triggers the error. The author verifies the installed JDK by opening a CMD window and running java -version.
Solution Steps
Adjust the Java version used in the project structure (File → Project Structure…).
In the Project Structure dialog, select Project and ensure the Project SDK and language level match the installed JDK (e.g., JDK 8).
Open Settings → Build, Execution, Deployment → Compiler → Java Compiler and set the Per module bytecode version to the same JDK version as the system.
Verify the JDK version configured under File → Settings matches the installed JDK.
Inspect the project's pom.xml for the Java version configuration (e.g., <java.version>8</java.version> or the maven-compiler-plugin settings) and adjust it to the correct version.
After aligning the IDE, compiler, and Maven settings with the installed JDK, the project starts without the “invalid source release” error.
That concludes the discussion of the IDEA startup error.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Coder Trainee
Experienced in Java and Python, we share and learn together. For submissions or collaborations, DM us.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
