Announcement Announcement Module
No announcement yet.
Running "mvn compile" with java version specified. Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Running "mvn compile" with java version specified.

    Hi all.

    I was developing my app in RPC for a while and everything was running smoothly. Then, I run "mvn clean" command and now I'm getting following errors during compilation:

    ...\[14,13] generics are not supported in -source 1.4
    (use -source 5 or higher to enable generics)
            private List<Product> returnList = new ArrayList<Product>();
    There are at least 15 of them and they are all related to the fact, that I have been using features from JDK5. I don't now how is it possible, that those classes have been compiled before. Some of them have been transfered from another project, so maybe they were not compiled before and after removing "*.class" files during "clean" command this might cause those errors.

    Anyways, my question is:

    How can I run MVN specifying Java version or where in my POM file can I specify the same thing?

    Best regards.
    Łukasz Bachman

  • #2
    Łukasz ,

    take a look at the pom.xml from the tiger module. That module's pom.xml contains an entry to compile against 1.5.

    hope this helps,



    • #3
      Have a look at the (sparse I agree) maven documentation. The compiler plugin is explained clearly and even has a sample which you can use right away.


      • #4
        Yeep, You were right guys.
        For clarity:
        I've added the code listed bellow to my POM file inside "plugins" tag:

        Works like a dream! :-)