Maven Install: “Annotations are not supported in -source 1.3”

前端 未结 5 1987
野趣味
野趣味 2020-12-11 01:40

When running mvn install on my project, i see it fail due to the following errors:

C:\\Repositories\\blah\\src\\test\\java\\com\\xxx\\qm\\testru         


        
5条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-11 02:22

    You are most likely using OpenJDK where the source level is 1.3 when not explicitly set - as opposed to Oracle JDK where the source level is 1.5.

    Since most modern Java projects target newer code than Java 5 you most likely need to set this anyway.

    Also note that if you need a lower target than source (e.g. for compiling with Java 6 but deploying to Java 5) you can do this by using the Eclipse compiler instead of Javac.

提交回复
热议问题