'IntelliJ IDEA - java: error: invalid source release: 18

I got the error while building.

enter image description here



Solution 1:[1]

Your project uses java 8 (denoted by 1.8) but your IDE is having Java 18. Upgrade your project to java 18 or change settings in your IDE to Java 8

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Praveen E