A friend of mine experienced this issue when working on building a Java project in Ubuntu 18.04.
When he runs the command:
maven clean build
He gets the warning:
[WARNING] Unable to autodetect 'javac' path, using 'javac' from the environment
And then gets this error:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.5.1:compile (default-compile) on project geostore-model: Compilation failure -> [Help 1]
Here's how it was solved:
The issue was that he did not have javac
(Java programming language compiler) installed on his machine. To confirm, we ran the command:
javac --version
And we got no version output
So we installed the Java development kit that contains javac
and all of its dependencies using the command:
sudo apt install default-jdk
Afterwhich we ran the command javac --version
and got the output:
javac 11.0.9.1
That's all.
I hope this helps