QuickTip : Invalid target release: 1.6 with mvn install

After working for around an year in Flex, I moved back to Java platform again. While building the project I am working on, I saw the following error:

[INFO] ————————————————————————
[INFO] ————————————————————————
[INFO] Compilation failure
Failure executing javac, but could not parse the error:
javac: invalid target release: 1.6
Usage: javac
where possible options include:
-g Generate all debugging info
-g:none Generate no debugging info
-g:{lines,vars,source} Generate only some debugging info
-nowarn Generate no warnings
-verbose Output messages about what the compiler is doing

Logically I changed my PATH environment variable to make JDK bin folder point to JDK version 1.6. Even after making changes, it still didn’t work. It took me a quite a lot of time to figure out that maven uses JAVA_HOME variable for executing the build which was pointing to the obvious, i.e. JDK 1.5. I changed it and it worked like a glove.

Posted in Java, QuickTip
4 comments on “QuickTip : Invalid target release: 1.6 with mvn install
  1. maestrolonganiza says:

    in Intellij IDEA:
    setting/Maven/Runner –> selected JRE 1.6

  2. Thanks, you solved my problem. I would never have guessed JAVA_HOME.

  3. Jeremy Anderson says:

    Many thanks, you solved my problem immediately. It’s a good thing you are still on the first page of Google, two years later!

Leave a Reply

Your email address will not be published. Required fields are marked *


CommentLuv badge

Welcome to Sampreshan
Technology Strategist, Speaker, Scrum/XP/Agile Trainer Coach and Trainer
Your interest areas

Get every new post on this blog delivered to your Inbox.

Join other followers: