java build failed,maven build failed:无法找到Javac编译器:jre或jdk问题

I have my JAVA_HOME set to

C:\Program Files (x86)\Java\jdk1.6.0_18

After I run maven install I get this message from eclipse:

Reason:

Unable to locate the Javac Compiler in:

C:\Program Files (x86)\Java\jre6\..\lib\tools.jar

Please ensure you are using JDK 1.4 or above and

not a JRE (the com.sun.tools.javac.Main class is required).

In most cases you can change the location of your Java

installation by setting the JAVA_HOME environment variable.

I'm certain that this is the tricky part

Please ensure you are using JDK 1.4 or

above and

not a JRE

When I run configuration its set to JRE6, how do I change it to JDK 1.6 which I have already installed

EDIT

I even tried to modify the plugin :

org.apache.maven.plugins

maven-compiler-plugin

2.0.2

1.6

1.6

C:\Program Files (x86)\Java\jdk1.6.0_18\bin

Still I get the same error

Maybe I forgot to say I use eclipse maven plugin .. how can I change from JRE to JDK in eclipse ?

解决方案

You could try updating the JDK Eclipse is using, as follows:

Add and set the JRE in Window->Preferences...->Java->Installed JREs:

JRE type: Standard VM JRE

Name: jdk1.6.0_18

JRE home directory: C:\Program Files (x86)\Java\jdk1.6.0_18

If this is not the case, it's possible that the brackets and spaces in the JAVA_HOME path are causing issues. Try copying your JDK to a different location and updating your JAVA_HOME.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值