[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 523
  • Last Modified:

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?
0
MeenuNagpal
Asked:
MeenuNagpal
1 Solution
 
CEHJCommented:
The error message comes as a result of running which command?
0
 
MeenuNagpalAuthor Commented:
I executed "mvn install"
0
Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

 
for_yanCommented:

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
 
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

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now