Error using javac: "javac: invalid flag: -s"

I am trying to specify a different version of the JDK in the maven-compiler-plugin . If the -source and -source set to 1.5, everything is fine. But when I try to use 1.6 JDK, maven reports an error. Has anyone encountered this issue?

Error:

Failed to execute javac, but could not parse the error: javac: invalid flag: -s Usage: javac where options are possible: -g Generate all debug information -g: none Do not create debug information

Thanks.

+6
source share
1 answer

If you use flag 1.6, your JAVA_HOME should point to JDK 1.6.

Verify this using java -version on the command line.

To define your JAVA_HOME, follow these steps:

Add this line to your ~/.bashrc :

 export JAVA_HOME=$(/usr/libexec/java_home) 

link: http://www.mkyong.com/java/how-to-set-java_home-environment-variable-on-mac-os-x/

+6
source

Source: https://habr.com/ru/post/919671/


All Articles