m2eclipse无法找到C:\Program Files \ Java @ \\ _jre6 \..\lib \ tools.jar [英] m2eclipse is unable to locate C:\Program Files\Java\jre6\..\lib\tools.jar

查看:145
本文介绍了m2eclipse无法找到C:\Program Files \ Java @ \\ _jre6 \..\lib \ tools.jar的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个问题,关于我的日食的jdk / jre用法。我知道这个问题在这里被问了很多次,我研究了很长一段时间可能出错的问题。我实际上没找到任何东西,所以我会再问你一次。也许我错过了一些东西(如果是的话,我希望不要尴尬:)

I have a problem, concerning the jdk/jre usage of my eclipse. I know that this question was asked and answered a lot of times here and I researched what could be wrong for quite a while. I actually didn't find anything so I'm going to ask you again. Maybe I'm missing something (if yes, I hope it's not to embarrasing :)

我的问题是,当我运行mvn clean install时出现错误其中说m2eclipse插件是无法找到Javac编译器:C:\Program Files \Java \jre6.. \ lib \ tools.jar。

My problem is, that when I'm running mvn clean install I get an error which says that the m2eclipse plugin is "Unable to locate the Javac Compiler in: C:\Program Files\Java\jre6..\lib\tools.jar".

我检查的第一件事是在eclipse中配置了正确的JRE。所以我切换到Window> Preferences> Java> Installed JREs并检查选中的jre是否是我jdk文件夹中的jre。情况就是这样。

First thing I checked was if the right JRE was configured in eclipse. So I switched into Window > Preferences > Java > Installed JREs and checked if the selected jre is the jre inside my jdk folder. This was the case.

我检查了eclipse.ini并添加了一个-vw标志。它现在看起来像:

I checked the eclipse.ini and added a -vw flag to it. It now looks like:

-startup
plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.100.v20110502
-product
org.eclipse.epp.package.java.product
--launcher.defaultAction
openFile
--launcher.XXMaxPermSize
256M
-showsplash
 org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
-vm
"%JAVA_HOME%\bin\javaw.exe"
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xms40m
-Xmx384m

%JAVA_HOME%被解析为C:\Program Files \ Java @ \\ _ddk1.6.0_24。因为它包含一个空格我用引号包围了vw路径。要检查路径是否真的正确,我试过

The %JAVA_HOME% is resolved to C:\Program Files\Java\jdk1.6.0_24. Since it contains a space I surrounded the vw path with quotes. To check if the path is really correct I tried

C:\Windows\System32>echo %JAVA_HOME%
C:\Program Files\Java\jdk1.6.0_24

告诉我它是正确的。我也尝试在启动eclipse时传递-vw选项。所以启动eclipse的命令就是

which tells me that it is correct. I also tried to pass the -vw option when eclipse is started. So the command to start eclipse was then

D:\Programs\eclipse\eclipse.exe -vm "%JAVA_HOME%\bin\javaw.exe"

我还测试了使用时是否存在差异%JAVA_HOME%符号或者如果我写了完整路径(没有区别)。

I also tested if there is a difference when I use the %JAVA_HOME% notation or if I writed the full path (it makes no difference).

eclipse的配置,当我去帮助>关于Eclipse时我得到>安装细节>配置,如下所示:

The configuration of eclipse, which I get when I go to Help > About Eclipse > Installation Details > Configuration, looks like that:

__wbp.gwt.useWebKit=true
awt.toolkit=sun.awt.windows.WToolkit
veclipse.application=org.eclipse.ui.ide.workbench
eclipse.buildId=M20120208-0800
eclipse.commands=-os
win32
-ws
win32
-arch
x86_64
-showsplash
-launcher
D:\Programs\eclipse\eclipse.exe
-name
Eclipse
--launcher.library
D:\Programs\eclipse\\plugins/org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.100.v20110    502\eclipse_1406.dll
-startup
D:\Programs\eclipse\\plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar
--launcher.overrideVmargs
-exitdata
3e30_64
-product
org.eclipse.epp.package.java.product
-vm
C:\Program Files\Java\jdk1.6.0_24\bin\javaw.exe
eclipse.home.location=file:/D:/Programs/eclipse/
eclipse.launcher=D:\Programs\eclipse\eclipse.exe
eclipse.launcher.name=Eclipse
eclipse.p2.data.area=@config.dir/../p2/
eclipse.p2.profile=epp.package.java
eclipse.product=org.eclipse.epp.package.java.product
eclipse.startTime=1335643108722
eclipse.vm=C:\Program Files\Java\jdk1.6.0_24\bin\javaw.exe
eclipse.vmargs=-Dosgi.requiredJavaVersion=1.5
-Xms40m
-Xmx384m
-XX:MaxPermSize=256m
[...]

我还尝试使用位于%的javaw.exe JAVA_HOME%\jre\bin\这也没有改变任何东西。

I also tried to use the javaw.exe that is located in %JAVA_HOME%\jre\bin\ which also doesn't change anything.

有一点有点奇怪的是,如果我删除对jre的引用,那就是不包含在jre中的引用jdk,在Window> Preferences> Java> Installed JREs中出现错误,指出指定的JRE安装不存在。

One thing that is a little bit strange is, that if I delete the reference to the jre, the one that is not included in jdk, in Window > Preferences > Java > Installed JREs I get an error which says "The specified JRE installation does not exist".

有谁知道我做错了什么?我想我尝试了任何工作,根据其他文章我发现我做得对。

Does anyone have an idea what I'm doing wrong? I think I tried anything to make it work and according to the other articles I found I'm doing it right.

Btw:我做了一些Maven更新项目依赖项和更新依赖关系工作,所以我没有得到任何错误。我唯一没做的就是重新启动计算机...

Btw: I did some Maven "Update Project Dependencies" and "Update Dependencies" which work, so I did not get any error there. The only thing, I did not do is to restart my computer...

推荐答案

我找到了一个似乎有效的解决方法。这不是我希望的解决方案,但至少我现在可以使用maven了。

I figured out a workaround that seems to work. It's not really that what I hoped to be a solution but at least I can use maven now.

我在文件系统中创建了一个与jdk和jre文件夹相同级别的新文件夹。我将其称为lib并将jdk中的tools.jar文件复制到其中。

I created a new folder on the same level in the file system as the jdk and the jre folders are. I called it lib and copied the tools.jar file form the jdk into it.

此外,我从用于Java SE的普通eclipse切换到用于Java EE的eclipse (我正在使用EJB)。 eclipse的版本是我们从大学获得的版本所以我不知道是否安装了一个我错过安装在我的(java SE)eclipse上的插件。

Additionally I switched from the "normal" eclipse for java SE to the eclipse for Java EE (I'm using EJBs). The version of eclipse is the one we got from university so i don't know if a plugin is installed which I missed to install on my (java SE) eclipse.

现在它似乎有用,但如果有人有一个解决方案可以更优雅地解决这个问题,请告诉我。

Now It seems to work but if anybody has a solution that might solve that problem in a more elegant way please let me know.

这篇关于m2eclipse无法找到C:\Program Files \ Java @ \\ _jre6 \..\lib \ tools.jar的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆