Mostafa Jamareh
Mostafa Jamareh

Reputation: 1439

why my maven compiling project using java 1.3

I'm using maven in my projects and my classes does not have any error but when i use mvn compile & package it gives me a various error as below:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler plugin:2.0.2:compile (default-compile) on project cassandra: Compilation failure: Compilation failure: [ERROR] /home/mostafa/idea/clonedatabase/src/main/java/ir/apk/tm/db/cassandra/DB.java:[119,11] generics are not supported in -source 1.3

[ERROR] (use -source 5 or higher to enable generics)

[ERROR] ArrayList List = new ArrayList();

[ERROR] . . . .

and the other errors is saying for-each loops are not supported in -source 1.3 & static import declarations are not supported in -source 1.3 &annotations are not supported in -source 1.3

my java version is 1.6 but i don't know why it is compiling my project using java 1.3 and i using intelliJ

also i set maven jdk and jre version to 1.6

Upvotes: 1

Views: 1676

Answers (1)

Stephen C
Stephen C

Reputation: 719446

By default Maven compiles with -source and -target levels at Java 1.5. So I suspect that your POM file is using the maven-compiler-plugin to set the levels differently.

Take a look at this page, and then see if your POM file has something similar.

Upvotes: 1

Related Questions