Vivek Dhiman
Vivek Dhiman

Reputation: 1997

Maven Build using 1.3 Error

I am trying to build my java application and getting compilation error as below :

[ERROR] /media/disk2/myapp/assignment/src/main/java/helper/HelperFunctions.java:[29,16] error: generics are not supported in -source 1.3

But java i am using is 1.7 version, I am using ubuntu14.04 on my mechine. Any idea how to solve this.

java -version
java version "1.7.0_76"
Java(TM) SE Runtime Environment (build 1.7.0_76-b13)
Java HotSpot(TM) 64-Bit Server VM (build 24.76-b04, mixed mode)

Upvotes: 0

Views: 38

Answers (1)

Saurabh Jhunjhunwala
Saurabh Jhunjhunwala

Reputation: 2922

Add the below tag in your pom.xml

<project>
  [...]
  <build>
    [...]
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <configuration>
          <!-- or whatever version you use -->
          <source>1.7</source>
          <target>1.7</target>
        </configuration>
      </plugin>
    </plugins>
    [...]
  </build>
  [...]
</project>

Upvotes: 2

Related Questions