IDEA: Error "javac: source release 1.7 requires target release 1.7"
When executing JUnit tests in IntelliJ IDEA, developers may encounter the error message "javac: source release 1.7 requires target release 1.7". This issue stems from a discrepancy between the source and target language levels configured in the project.
Resolving the Error
To rectify this issue, it is crucial to ensure that both the source and target language levels are correctly set to 1.7. This can be adjusted in several locations within IDEA:
Additionally, Maven projects may have their own language level settings. Check the pom.xml file for the following configurations:
If these settings are present, ensure they are changed to 1.7. Maven will automatically adjust the project settings after the project is reimported into IDEA.
By aligning both the source and target language levels within IDEA and addressing potential Maven configuration, this error can be effectively resolved.
The above is the detailed content of How to Fix the 'javac: source release 1.7 requires target release 1.7' Error in IntelliJ IDEA?. For more information, please follow other related articles on the PHP Chinese website!