javac: invalid flag: -s
Case
After updating my project and launching a build with Maven, I got this error:
[java][ERROR] BUILD FAILURE
[INFO] ————————————————————————
[INFO] Compilation failure
Failure executing javac, but could not parse the error:
javac: invalid flag: -s
Usage: javac <options> <source files>[/java]
Fix
Indeed the version of Java in the pom.xml
had been upgraded. To get rid of the error, update your $JAVA_HOME
to use a JDK 6 and no more a JDK5.