Hobione's Weblog

Living & Breathing in Web 2.0 Era

MyEclipse Maven Error: Generics are not supported in -source 1.3

Problem: I got this error:

C:\WorkspaceMyEclipse\HRTrainingPersistence\src\main\java\gov\faa\amc\nas\hrtraining\persistence\TrainingClass.java:[45,2] annotations are not supported in -source 1.3</pre>
(use -source 5 or higher to enable annotations)
 @Override
<pre>

Solution: Maven’s default java complier is 1.3 (very weird).  I had to add a plugin tag for Java 1.5,  right after <dependencies> tag.

<build>
   <!-- For annotations and other Java5 stuff -->
<plugins>
<plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <configuration>
          <source>1.5</source>
          <target>1.5</target>
        </configuration>
      </plugin>
    </plugins>
  </build>

References: Maven Documentation Home

Q: How to setup Maven JDK Home?
Maven JDK Home setup

Reference: How to fix Maven ‘Add JDK’ warning?

March 4, 2009 - Posted by HobiOne | Maven | | 1 Comment

1 Comment »

  1. [...] Hobione’s Blog entry on the same [...]

    Pingback by Maven Error: generics are not supported in source 1.3 « Draptik's Blog | June 22, 2009 | Reply


Leave a comment