java - generic not supported in 1.3 error even when java_home point jdk1.7 in maven build -


im getting below message when run mvn clean install

[error] build failure [info] ------------------------------------------------------------------------ [info] compilation failure  d:\data\work\extjs.parser\src\main\java\com\model\component.java:[17,15] error: generics not supported in -source 1.3  not parse error message:   (use -source 5 or higher enable generics) d:\data\work\extjs.parser\src\main\java\com\model\container.java:14: error: gene rics not supported in -source 1.3     private list<component> items; 

the project simple maven project wont compile generics error when have set java_home jdk1.7 installation path

however when add plug in works fine. why required explicitly set hava home path.

<plugin>             <groupid>org.apache.maven.plugins</groupid>             <artifactid>maven-compiler-plugin</artifactid>             <configuration>                 <source>1.7</source>                 <target>1.7</target>                 <showdeprecation>true</showdeprecation>                 <showwarnings>true</showwarnings>                 <executable>${env.java_home}/bin/javac</executable>                 <fork>true</fork>             </configuration>         </plugin> 

thanks in advanced...

you need tell maven use jdk 1.5 compile source code explicitly. declare maven compiler plugin (maven-compiler-plugin) in pom.xml file, :

<project ...>   <dependencies>    ...   </dependencies>   <build>     <plugins>        <plugin>            <groupid>org.apache.maven.plugins</groupid>            <artifactid>maven-compiler-plugin</artifactid>            <version>2.3.1</version>            <configuration>                <source>1.5</source>                <target>1.5</target>            </configuration>        </plugin>     </plugins>   </build> </project> 

Comments

Popular posts from this blog

monitor web browser programmatically in Android? -

Shrink a YouTube video to responsive width -

wpf - PdfWriter.GetInstance throws System.NullReferenceException -