Maven默认是用JDK1.3去编译, 当代码中遇到注解、泛型等功能时,就会出如下错误:
“annotations are not supported in -source 1.3”
解决办法:
在项目pom.xml文件添加如下内容,强制用指定的JDK版本编译;
“annotations are not supported in -source 1.3”
解决办法:
在项目pom.xml文件添加如下内容,强制用指定的JDK版本编译;
<project>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.5</source>
<target>1.5</target>
</configuration>
</plugin>
</plugins>
</build>
</project>