I'm following a PluralSight course, "Spring Framework: Spring Fundamentals" by Bryan Hansen. I've followed the demo precisely (I believe) but am getting the error message "Error:java: Source option 5 is no longer supported. Use 6 or later.".
I'm using the latest version of IntelliJ, with the following configurations:
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>11</source>
<target>11</target>
</configuration>
</plugin>
</plugins>
</build>
I've looked at some other similar posts, and they seem to sometimes have the above configuration as 1.6 instead of 11, but I'm trying to follow this tutorial closely. Am still curious as to the discrepancy here.
Not sure what's casuing this error to be thrown, as far as I can tell I've got everything set up correctly but clearly that's not the case. Any help would be appreciated.
Right click on Project > Maven > Update the project. Right click on Project > Run As > Maven install -- The pom. xml file is running and java jars are download and installed to project.
The error (Source option 5 is no longer supported) is common when we create a Maven project from the old archetypes. In this case, we need to specify the source and target version to the Maven compiler. We can specify these properties in Maven pom. xml file.
The source options modify the way the compiler treats the physical source files.
Chances are that it just runs fine with Java 11. Hint: You can speed up multi-module Maven projects by using parallel builds, e.g. mvn -T 4 compile compiles all modules in parallel on 4 CPU cores.
Fixed this by doing the following.
Project Structure > Modules (under Project Settings) > Set language level to 11
Hope this helps someone who runs in to the same issue.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With