Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Maven: WARNING Unable to autodetect 'javac' path, using 'javac' from the environment

When running Maven, I get this output:

[WARNING] Unable to autodetect 'javac' path, using 'javac' from the environment.

How do I fix this?

like image 677
Aaron Digulla Avatar asked Nov 08 '13 14:11

Aaron Digulla


1 Answers

You will see this error message when Maven is being run using a JRE (Java Runtime Environment) which is a stripped down version of Java that can only execute Java code but can't compile sources.

To fix the warning, install the JDK (Java Development Kit) and set the environment variable JAVA_HOME to the newly installed version of Java.

You can put this into the file .mavenrc if you want; then only Maven will use this version of Java.

like image 147
Aaron Digulla Avatar answered Sep 16 '22 18:09

Aaron Digulla