2
votes

Hi when I run on my cmd the command

mvn clean package

I get a compiler error: No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?

But I checked out my PATH, JAVA_HOME and HOME_M2enter image description hereenter image description hereenter image description here

I also checked the Installed JREs in Eclipse: enter image description here

Apparently everything is ok, any ideas about why do I'm getting that error? Thanks!

2
one thing I found weird is why its showing JRE7u65 if you have installed jdk8u40 ? - Bilbo Baggins
the problem is in your PATH; replace the jre directory declared there with your jdk directory. Also note that whatever setting you have in eclipse, it will affecting launching from the ide, not what happens using cmd line - guido
Add jdk bin to your path , It will solve the issue.Setting Jdk Home is just not enough' - Jishnu Prathap

2 Answers

4
votes

Your problem is that in your PATH is only a JRE, not a JDK.

highlighted path

You have to include the JDK into your PATH, then maven will find it.

0
votes

https://roufid.com/no-compiler-is-provided-in-this-environment/

Do set your JAVA_HOME.

export JAVA_HOME=path_to_jdk 

try again