Maven (commandline): No compiler is provided in th

2019-02-12 03:58发布

Failed to execute goal or.apache.maven.plugins:maven-compiler-plugin:3.1:comple <default-compile> on project google-play-services: Compilation failure

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

This is the result when using the Android SDK Deployer from the commandline in Windows. I added JAVA_HOME C:\Program Files (x86)\Java\jdk1.7.0_45 to my system variables.

Did I configured the wrong parts?

enter image description here

3条回答
Summer. ? 凉城
2楼-- · 2019-02-12 04:35

The problem was very easy to solve. I only had to restart the commandline after changing the system variables.

查看更多
Explosion°爆炸
3楼-- · 2019-02-12 04:53

This error can also happen if you install a new version of JAVA (JRE), because the Java installer change the order of environment variables on Windows.

So, verify the PATH values in the System Variables. If you see the:

C:\Program Files (x86)\Common Files\Oracle\Java\javapath

Or:

C:\ProgramData\Oracle\Java\javapath

On the top of the list, edit the PATH and change the order of the previous paths to stay below to the JDK path variable (per example, C:\Program Files\Java\jdk1.8.0_162\bin).

查看更多
We Are One
4楼-- · 2019-02-12 04:54

Normally this happens, compilation of the source cannot be done from JRE(Runtime Environment) its for running the compiled code.

So first thing should done is validating JAVA_HOME path defined in environment variables.

it should be directed to JDK. eg:

C:\Program Files (x86)\Java\jdk1.8.0_111

查看更多
登录 后发表回答