How to fix invalid target release: 1.7, 1.8, 1.9, or 1.10 Error in Maven Build
If you are building your Java project using Maven, maybe in Eclipse or from the command prompt by running mvn install and your build is failing with an error like "invalid target release: 1.7" or "invalid target release: 1.8" then you have come to the right place. In this article, I'll show you the reason why this error occurs and how you can deal with these errors even with higher Java version like Java 9, 10 installed on your machine, or maybe with Java 11 in the coming month. The root cause of the problem is that you have specified a higher Java version in your pom.xml file for Maven compiler plugin then what Maven knows in your system, and that's why it's saying invalid target release. A simple solution to this problem is either reduce your target version in pom.xml or install a new Java version if you want to build your project in higher version But, the key to solving this problem is knowing that Maven picks the Java version from the JAVA_HOME...