简体   繁体   中英

Intelij IDEA - Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.0.2:compile

I'm using java 7 to compile my class files using maven /usr/lib/jvm/java-1.7.0-openjdk-amd64/bin/java , but still i'm getting below errors. What might i be doing wrong ?

    Compilation failure:
    error: generics are not supported in -source 1.3
    error: annotations are not supported in -source 1.3

IntelliJ preference > Java > Compiler > Set language level to 1.7

Project > properties > Project language level > Set language level to 1.7

You have change your pom file:

<project>
  [...]
  <build>
    [...]
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.2</version>
        <configuration>
          <source>1.7</source>
          <target>1.7</target>
        </configuration>
      </plugin>
    </plugins>
    [...]
  </build>
  [...]
</project>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM