mvn install on Linux

Posted on 2011-05-06
Last Modified: 2012-08-13
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/[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?
Question by:MeenuNagpal
    LVL 86

    Expert Comment

    The error message comes as a result of running which command?

    Author Comment

    I executed "mvn install"
    LVL 47

    Expert Comment

    LVL 47

    Accepted Solution


    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:

    Open in new window

    LVL 47

    Expert Comment

    Maybe you want to use newer maven - I guess the current version is 3.0.3

    Author Comment

    @for yan I installed maven in ubuntu. I only got option to install maven2 in Synaptic package manager. Will try installing latest version manually.
    LVL 92

    Expert Comment

    you don't need to use the maven-compiler-plugin
    and you probably don't want to be using 1.5 either

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Suggested Solutions

    Little introduction about CP: CP is a command on linux that use to copy files and folder from one location to another location. Example usage of CP as follow: cp /myfoder /pathto/destination/folder/ cp abc.tar.gz /pathto/destination/folder/ab…
    Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
    Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
    This video teaches viewers about errors in exception handling.

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    12 Experts available now in Live!

    Get 1:1 Help Now