I can't build my maven java web application, because of the following two errors:
diamond operator is not supported in -source 1.5
(use -source 7 or higher to enable diamond operator)
multi-catch statement is not supported in -source 1.5
(use -source 7 or higher to enable multi-catch statement)
I'm confused, because i use java 1.8.0 for my project, i never have actually used 1.5
What could be causing this problem and how do i solve it?
I tried to build it after adding the follwing lines in the pom.xml, but without succes:
<properties>
<sourceJdk>1.8</sourceJdk>
<targetJdk>1.8</targetJdk>
</properties>
Try declaring the
maven-compiler-plugin
in your pom.You can also add it in this way as well by including this in your pom.xml