Resolved: javac: invalid target release: 1.6

javac: invalid target release: 1.6 :
Recently I ran into this while compiling some stuff through Maven. My development environment is Mac OS X(10.5), Eclipse (3.5), Maven (2.0.9), Java (1.6)
I tried some suggestions through Google but they didn’t help me. Finally resolved the isse. Follow this steps:

  • Check if JAVA_HOME is set
  • Check if PATH is set & it’s pointing to same Java version
  • Now another important thing – Run mvn –version, check if the Java version matches.
(Mac Users)If do this:
Check your CurrentJDK path defined under "/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK".
That is most likely the culprit. Maven script uses this symlink value.

You are hopefully done :)

Leave a comment

Your comment

Get Adobe Flash playerPlugin by wpburn.com wordpress themes