mvn install on Linux

I am trying to run java project on Linux with maven. Although the java version which I have installed is 1.6.0_20, I get following exception

/home/administrator/Desktop/development/eclipse/com.radsdk.framework/src/main/java/com/radsdk/ValueBase.java:[61,2] annotations are not supported in -source 1.3
(use -source 5 or higher to enable annotations)

the mvn --version returns following
Apache Maven 2.2.1 (rdebian-4)
Java version: 1.6.0_20
Java home: /usr/lib/jvm/java-6-openjdk/jre
Default locale: en_US, platform encoding: UTF-8

I guess I need to change the VM configuration. Any idea?
MeenuNagpalAsked:
Who is Participating?
 
for_yanConnect With a Mentor Commented:

from the prvious link, but corrected syntax:
You need to tell the maven-compiler-plugin to use java 1.5. Add this to your pom.xml:
<project>
...
  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>2.0.2</version>
        <configuration>
          <source>1.5</source>
          <target>1.5</target>
        </configuration>
      </plugin>
    </plugins>
  </build>
</project>

Open in new window

0
 
CEHJCommented:
The error message comes as a result of running which command?
0
 
MeenuNagpalAuthor Commented:
I executed "mvn install"
0
Cloud Class® Course: Certified Penetration Testing

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

 
for_yanCommented:
Maybe you want to use newer maven - I guess the current version is 3.0.3
0
 
MeenuNagpalAuthor Commented:
@for yan I installed maven in ubuntu. I only got option to install maven2 in Synaptic package manager. Will try installing latest version manually.
0
 
objectsCommented:
you don't need to use the maven-compiler-plugin
and you probably don't want to be using 1.5 either
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.