m2eclipse: Eclipse在JRE中运行,但是需要一个JDK。

时间:2023-01-24 23:16:17

I have a problem with m2eclipse (0.10.0) together with eclipse galileo (Build id: 20090920-1017).

我对m2eclipse(0.10.0)和eclipse galileo(构建id: 20090920-1017)有一个问题。

I always get the error message:"Eclipse is running in a JRE, but a JDK is required". I have tried several things, but nothing works. The error message is still there. Here are the things I have tried:

我总是得到错误消息:“Eclipse在JRE中运行,但是需要JDK”。我试过几次,但都没有用。错误消息仍然存在。以下是我尝试过的方法:

  • In Window>Preferences>Java>Installed JREs I checked JDK1.6.0_20. DOES NOT WORK

    在窗口>首选项>Java>安装了JREs,我检查了JDK1.6.0_20。不工作

  • In Window>Preferences>Java>Installed JREs I removed all JREs. Only the checked JDK1.6.0_20 is still there. DOES NOT WORK

    在窗口>偏好>Java>安装了JREs我删除了所有的JREs。只有检查过的JDK1.6.0_20还在那里。不工作

  • In Window>Preferences>Java>Installed JREs>Execution Environments I choosed JavaSE-1.6 and checked JDK1.6.0_20[perfect match]. DOES NOT WORK.

    在窗口>偏好中>Java>安装了JREs>执行环境,我选择了JavaSE-1.6并检查了JDK1.6.0_20[完美匹配]。不工作。

  • In Preferences of the eclipse desktop start icon I added the -vm parameter (C:\Programme\eclipse_galileo\eclipse\eclipse.exe -vm C:\Programme\Java\jdk1.6.0_20\bin). DOES NOT WORK.

    在eclipse desktop start图标的首选项中,我添加了-vm参数(C:\ program \eclipse_galileo\eclipse\eclipse)。exe vm C:\ \ Java \ jdk1.6.0_20 \ bin)。不工作。

  • I added the clean parameter (C:\Programme\eclipse_galileo\eclipse\eclipse.exe -vm C:\Programme\Java\jdk1.6.0_20\bin -clean). DOES NOT WORK.

    我添加了clean参数(C:\ program \eclipse_galileo\eclipse\eclipse)。exe vm C:\程序\ Java \ jdk1.6.0_20 \ bin,抹杀)。不工作。

  • I added the -vm parameter to the eclipse.ini file with a carriage return after -vm and C:/Programme/Java/jdk1.6.0_20/bin/javaw.exe in a new line. DOES NOT WORK.

    我在eclipse中添加了-vm参数。在-vm和C:/程序/Java/jdk1.6.0_20/bin/javaw之后,使用回车返回的ini文件。exe在一条新直线上。不工作。

  • After doing all these things I removed the m2eclipse plugin and installed it once again. DOES NOT WORK.

    在做了所有这些事情之后,我删除了m2eclipse插件并重新安装了它。不工作。

New ideas I have tried:

我尝试过的新想法:

  • In Preferences of the eclipse desktop start icon I put the executable at the end (C:\Programme\eclipse_galileo\eclipse\eclipse.exe -vm C:\Programme\Java\jdk1.6.0_20\bin\javaw.exe). DOES NOT WORK.

    在eclipse桌面启动图标的首选项中,我将可执行文件放在了末尾(C:\程序\eclipse_galileo\eclipse\eclipse)。exe vm C:\程序\ Java \ jdk1.6.0_20 \ bin \ javaw.exe)。不工作。

  • I changed in eclipse.ini the slashes to backslashes. DOES NOT WORK.

    我改变了在eclipse中。将斜杠改为反斜杠。不工作。

Here is my eclipse.ini file:

这是我的eclipse。ini文件:

-startup
plugins/org.eclipse.equinox.launcher_1.0.201.R35x_v20090715.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.0.200.v20090519
-product
org.eclipse.epp.package.jee.product
--launcher.XXMaxPermSize
256M
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
-vm
C:\Programme\Java\jdk1.6.0_20\bin\javaw.exe
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xms40m
-Xmx512m

Is anyone out there who have other ideas? Any help is appreciated.

有人有其他想法吗?任何帮助都是感激。

Thank You very much. GernoK

非常感谢。GernoK

15 个解决方案

#1


25  

Unbelievable, the solution to this problem has nothing to do with slashes, backslashes, quotes, spaces, jre, jdk, jvm, javaw, ....

难以置信,此问题的解决方案和斜杠无关,反斜杠,报价、空间、jre,jdk,jvm,javaw,....

The answer is that you have to have a line break between

答案是,你必须在两者之间有一条分界线。

-vm

虚拟机

and the path.

和路径。

So in the eclipse.ini file:

所以在eclipse。ini文件:

THIS WILL NOT WORK:

这将不工作:

-vm C:\java\jdk\bin\javaw.exe

BUT THIS WILL:

但这将:

-vm
C:\java\jdk\bin\javaw.exe

#2


13  

MARIO-ORTEGON answered is the right answer to this problem. The only thing you need to do is to move this line "-vm C:\java\jdk\bin\javaw.exe" under the section -product org.eclipse.epp.package.jee.product in eclipse.ini. like this: -product org.eclipse.epp.package.jee.product -vm C:\java\jdk\bin\javaw.exe save and restart the eclipse. Error will be gone.

这个问题的正确答案是MARIO-ORTEGON。您需要做的惟一一件事就是移动这一行”-vm C:\java\jdk\bin\javaw。exe“在section -product org.eclipse.epp.package.jee中”。在eclipse.ini产品。这样的:产品org.eclipse.epp.package.jee。产品vm C:\ java \ jdk \ bin \ javaw。exe保存并重新启动eclipse。错误将会消失。

#3


10  

I think these are answers needed when editing the eclipse.ini or STS.ini files:

我认为这些是编辑eclipse时需要的答案。ini或针。ini文件:

A lot of people make these mistakes because they make certain assumptions (which is not correct):

很多人会犯这些错误,因为他们做了一些假设(这是不对的):

  1. Mistake #1: Writing the parameters in the same line. Unlike JVM command line, Eclipse expects every parameters to be placed in different line in its eclipse.ini file. One of the most common mistake is (which should be written in 2 separated lines):

    错误#1:在同一行中写入参数。与JVM命令行不同,Eclipse希望每个参数在其Eclipse中处于不同的行中。ini文件。最常见的错误之一是(应该用两行分开写):

    -vm c:/Java/jdk1.6.0_31/bin/javaw.exe

    vm c:/ Java / jdk1.6.0_31 / bin / javaw.exe

  2. Mistake #2: Writing the -vm and -vmargs in the wrong order. Sequence does matter. The -vmargs has to be put before the -vm. Why? Because once the -vm has been specified, the VM will be fully specified and the rest of the -vmargs will be ignored.

    错误#2:以错误的顺序编写-vm和-vmargs。顺序很重要。vmarg必须放在-vm前面。为什么?因为一旦指定了-vm, VM将被完全指定,其余的-vmargs将被忽略。

  3. Mistake #3: Assuming the eclipse.ini will stay the same if you don't change it. Some plugins installation may have auto configuration (which after restarting automagically change the eclipse.ini file, or other .ini config file, e.g. STS.ini if you are using SpringSource Tool Suite for example), they will append indiscriminately the -vm before the -vmargs. Check for double occurrence of -vm or -vmargs.

    错误#3:假设eclipse。如果你不改变,ini也会保持不变。一些插件安装可能具有自动配置(在重新启动自动更改eclipse之后)。ini文件,或其他。ini配置文件,例如STS。如果您正在使用SpringSource工具套件,那么它们将在-vmargs之前不加选择地添加-vm。检查双发生的-vm或-vmargs。

  4. Mistake #4: Pointing to the path of JVM, instead of the binary when specifying -vm. Eclipse expects the Java JVM binary, not just the JAVA_HOME path e.g. -vm c:/Java/jdk1.6.0_31/bin/javaw.exe not just -vm c:/Java/jdk1.6.0_31

    错误#4:指向JVM的路径,而不是在指定-vm时使用二进制。Eclipse期望Java JVM二进制文件,而不仅仅是JAVA_HOME路径。exe不只是-vm c:/Java/jdk1.6.0_31。

For the original question, it seems the Mistake #2 is the cause. Instead of the one, you should move the -vm to the end, after -vmargs:

对于最初的问题,似乎错误#2是原因。而不是一个,你应该把-vm移到最后,在-vmargs:

-startup
plugins/org.eclipse.equinox.launcher_1.0.201.R35x_v20090715.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.0.200.v20090519
-product
org.eclipse.epp.package.jee.product
--launcher.XXMaxPermSize
256M
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xms40m
-Xmx512m
-vm
C:\Programme\Java\jdk1.6.0_20\bin\javaw.exe

#4


4  

I had the same problem with Eclipse reporting that it was running in the JRE (Win7 x64, 32 Bit JDK 1.6 update 21), even though I was specifying that it should use the JDK.

我在Eclipse报告中遇到了同样的问题,它在JRE中运行(Win7 x64, 32位JDK 1.6更新21),尽管我指定它应该使用JDK。

I finally deleted JRE6 which is optionally installable with the JDK and the message disappeared.

我最后删除了JRE6,它是可选的与JDK一起安装的,消息消失了。

Someone with a deeper understanding of Windows will have to explain why it does this, but it is apparently ignoring the eclipse.ini setting, as well as JAVA_HOME and starting eclipse in the JRE anyway.

对Windows有更深入了解的人将不得不解释它为什么这么做,但它显然忽略了eclipse。无论如何,在JRE中设置,以及JAVA_HOME和启动eclipse。

My eclipse.ini:

我的eclipse.ini:

-vm
C:/Java/jdk1.6.0_21/bin/javaw.exe
-startup
plugins/org.eclipse.equinox.launcher_1.0.201.R35x_v20090715.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.0.200.v20090519
-product
org.eclipse.epp.package.jee.product
-nosplash
org.eclipse.platform
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xms32m
-Xmx1024m
-Xss6m
-XX:PermSize=32m
-XX:MaxPermSize=256m
-XX:CompileThreshold=5
-XX:MaxGCPauseMillis=10
-XX:MaxHeapFreeRatio=70
-XX:+UseParallelGC
-XX:+AggressiveOpts
-Dcom.sun.management.jmxremote

JAVA_HOME

JAVA_HOME

C:\Windows\system32>echo %JAVA_HOME%
C:\Java\jdk1.6.0_21

#5


2  

I think you have to explicity add the executable to the -vm argument:

我认为你必须将可执行文件添加到-vm参数中:

C:\Programme\eclipse_galileo\eclipse\eclipse.exe -vm C:\Programme\Java\jdk1.6.0_20\bin\javaw

Regarding the ini file, it depends on the full contents. What does your ini file contains?

关于ini文件,它取决于完整的内容。你的ini文件包含什么?

#6


2  

Put these lines at the beginning of the eclipse.ini file:

将这些行放在eclipse的开头。ini文件:

-vm
G:/dev/jdk1.6.0_19/bin/javaw.exe

#7


1  

I'm getting the same error message as soon as I remove these two lines

当我删除这两行代码时,我将得到相同的错误消息。

-vm
C:\Programme\Java\jdk1.6.0_10\bin\javaw.exe

from my eclipse.ini file. Maybe you should use backslashes in that eclipse.ini.

从我的eclipse。ini文件。也许你应该在eclipse.ini中使用反斜线。

#8


0  

There are two JVMs involved here; the one that Eclipse is running in and the one (or more) that the different projects in your workspace run in. I think this message refers to the JVM that Eclipse is running in. So, the solution is not contained in the "Installed JREs" section within Eclipse. It's the JVM that's in your path within Windows.

这里涉及两个jvm;Eclipse正在运行的一个和一个(或多个)在您的工作区中运行的不同项目。我认为这个消息是指Eclipse正在运行的JVM。因此,解决方案不包含在Eclipse中“安装的JREs”部分中。它是在窗口内的路径中的JVM。

#9


0  

Java may be finding its files using the JAVA_HOME environment variable. Try changing it to C:\Programme\Java\jdk1.6.0_20

Java可能正在使用JAVA_HOME环境变量查找其文件。试着把它改到C:\ \Java\jdk1.6.0_20。

In Windows XP, this is under Control Panel, System, Advanced tab, Environment Variables button.

在Windows XP中,这是在控制面板,系统,高级选项卡,环境变量按钮。

#10


0  

Uninstall the JRE leaving ONLY the JDK and private JRE behind. Run Eclipse, and it will immediately complain that it can't find a JRE or JDK (assuming the -vm option is missing or wrong in your ini).

卸载JRE只留下JDK和私有JRE。运行Eclipse,它会立即抱怨它找不到JRE或JDK(假设-vm选项在您的ini中丢失或错误)。

Now put the -vm path to javaw in your ini file, save and Eclipse will now load the JDK.

现在将-vm路径放到ini文件中,保存和Eclipse将加载JDK。

I actually went ahead and uninstalled everything Java and then reinstalled JDK 6 leaving out the public JRE and the database portion of the install.

实际上,我先卸载了Java,然后重新安装JDK 6,省去了公共JRE和安装的数据库部分。

#11


0  

The uninstall method is the only thing that worked for me. No amount of -vm magic made it happen until I only had the JDK installed.

卸载方法是我唯一有效的方法。在我只安装JDK之前,没有任何数量的vm魔法。

#12


0  

I had the same problem but solved it. Add the -vm option as the first line in your eclipse.ini file and it will work.

我有同样的问题但解决了。在eclipse中添加-vm选项作为第一行。ini文件,它会工作。

#13


0  

Try adding this:

尝试添加:

-vm E:\java\jdk1.6\jre\bin\client\jvm.dll

#14


0  

I too had this issue. This problem disappeared when I upgrade to Eclipse Indigo. So try with Higher version.

我也有这个问题。当我升级到Eclipse Indigo时,这个问题就消失了。所以试着用更高的版本。

#15


0  

Check your Installed JRE setting of Eclipse. It should point to JDK rather than JRE. Though it is a JRE setup. Remember JDK contains JRE and when Maven runs it tries to find out JDK mostly tools.jar.

检查安装的Eclipse JRE设置。它应该指向JDK而不是JRE。虽然它是一个JRE设置。记住,JDK包含JRE,当Maven运行时,它试图找出JDK的主要工具。

#1


25  

Unbelievable, the solution to this problem has nothing to do with slashes, backslashes, quotes, spaces, jre, jdk, jvm, javaw, ....

难以置信,此问题的解决方案和斜杠无关,反斜杠,报价、空间、jre,jdk,jvm,javaw,....

The answer is that you have to have a line break between

答案是,你必须在两者之间有一条分界线。

-vm

虚拟机

and the path.

和路径。

So in the eclipse.ini file:

所以在eclipse。ini文件:

THIS WILL NOT WORK:

这将不工作:

-vm C:\java\jdk\bin\javaw.exe

BUT THIS WILL:

但这将:

-vm
C:\java\jdk\bin\javaw.exe

#2


13  

MARIO-ORTEGON answered is the right answer to this problem. The only thing you need to do is to move this line "-vm C:\java\jdk\bin\javaw.exe" under the section -product org.eclipse.epp.package.jee.product in eclipse.ini. like this: -product org.eclipse.epp.package.jee.product -vm C:\java\jdk\bin\javaw.exe save and restart the eclipse. Error will be gone.

这个问题的正确答案是MARIO-ORTEGON。您需要做的惟一一件事就是移动这一行”-vm C:\java\jdk\bin\javaw。exe“在section -product org.eclipse.epp.package.jee中”。在eclipse.ini产品。这样的:产品org.eclipse.epp.package.jee。产品vm C:\ java \ jdk \ bin \ javaw。exe保存并重新启动eclipse。错误将会消失。

#3


10  

I think these are answers needed when editing the eclipse.ini or STS.ini files:

我认为这些是编辑eclipse时需要的答案。ini或针。ini文件:

A lot of people make these mistakes because they make certain assumptions (which is not correct):

很多人会犯这些错误,因为他们做了一些假设(这是不对的):

  1. Mistake #1: Writing the parameters in the same line. Unlike JVM command line, Eclipse expects every parameters to be placed in different line in its eclipse.ini file. One of the most common mistake is (which should be written in 2 separated lines):

    错误#1:在同一行中写入参数。与JVM命令行不同,Eclipse希望每个参数在其Eclipse中处于不同的行中。ini文件。最常见的错误之一是(应该用两行分开写):

    -vm c:/Java/jdk1.6.0_31/bin/javaw.exe

    vm c:/ Java / jdk1.6.0_31 / bin / javaw.exe

  2. Mistake #2: Writing the -vm and -vmargs in the wrong order. Sequence does matter. The -vmargs has to be put before the -vm. Why? Because once the -vm has been specified, the VM will be fully specified and the rest of the -vmargs will be ignored.

    错误#2:以错误的顺序编写-vm和-vmargs。顺序很重要。vmarg必须放在-vm前面。为什么?因为一旦指定了-vm, VM将被完全指定,其余的-vmargs将被忽略。

  3. Mistake #3: Assuming the eclipse.ini will stay the same if you don't change it. Some plugins installation may have auto configuration (which after restarting automagically change the eclipse.ini file, or other .ini config file, e.g. STS.ini if you are using SpringSource Tool Suite for example), they will append indiscriminately the -vm before the -vmargs. Check for double occurrence of -vm or -vmargs.

    错误#3:假设eclipse。如果你不改变,ini也会保持不变。一些插件安装可能具有自动配置(在重新启动自动更改eclipse之后)。ini文件,或其他。ini配置文件,例如STS。如果您正在使用SpringSource工具套件,那么它们将在-vmargs之前不加选择地添加-vm。检查双发生的-vm或-vmargs。

  4. Mistake #4: Pointing to the path of JVM, instead of the binary when specifying -vm. Eclipse expects the Java JVM binary, not just the JAVA_HOME path e.g. -vm c:/Java/jdk1.6.0_31/bin/javaw.exe not just -vm c:/Java/jdk1.6.0_31

    错误#4:指向JVM的路径,而不是在指定-vm时使用二进制。Eclipse期望Java JVM二进制文件,而不仅仅是JAVA_HOME路径。exe不只是-vm c:/Java/jdk1.6.0_31。

For the original question, it seems the Mistake #2 is the cause. Instead of the one, you should move the -vm to the end, after -vmargs:

对于最初的问题,似乎错误#2是原因。而不是一个,你应该把-vm移到最后,在-vmargs:

-startup
plugins/org.eclipse.equinox.launcher_1.0.201.R35x_v20090715.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.0.200.v20090519
-product
org.eclipse.epp.package.jee.product
--launcher.XXMaxPermSize
256M
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xms40m
-Xmx512m
-vm
C:\Programme\Java\jdk1.6.0_20\bin\javaw.exe

#4


4  

I had the same problem with Eclipse reporting that it was running in the JRE (Win7 x64, 32 Bit JDK 1.6 update 21), even though I was specifying that it should use the JDK.

我在Eclipse报告中遇到了同样的问题,它在JRE中运行(Win7 x64, 32位JDK 1.6更新21),尽管我指定它应该使用JDK。

I finally deleted JRE6 which is optionally installable with the JDK and the message disappeared.

我最后删除了JRE6,它是可选的与JDK一起安装的,消息消失了。

Someone with a deeper understanding of Windows will have to explain why it does this, but it is apparently ignoring the eclipse.ini setting, as well as JAVA_HOME and starting eclipse in the JRE anyway.

对Windows有更深入了解的人将不得不解释它为什么这么做,但它显然忽略了eclipse。无论如何,在JRE中设置,以及JAVA_HOME和启动eclipse。

My eclipse.ini:

我的eclipse.ini:

-vm
C:/Java/jdk1.6.0_21/bin/javaw.exe
-startup
plugins/org.eclipse.equinox.launcher_1.0.201.R35x_v20090715.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.0.200.v20090519
-product
org.eclipse.epp.package.jee.product
-nosplash
org.eclipse.platform
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xms32m
-Xmx1024m
-Xss6m
-XX:PermSize=32m
-XX:MaxPermSize=256m
-XX:CompileThreshold=5
-XX:MaxGCPauseMillis=10
-XX:MaxHeapFreeRatio=70
-XX:+UseParallelGC
-XX:+AggressiveOpts
-Dcom.sun.management.jmxremote

JAVA_HOME

JAVA_HOME

C:\Windows\system32>echo %JAVA_HOME%
C:\Java\jdk1.6.0_21

#5


2  

I think you have to explicity add the executable to the -vm argument:

我认为你必须将可执行文件添加到-vm参数中:

C:\Programme\eclipse_galileo\eclipse\eclipse.exe -vm C:\Programme\Java\jdk1.6.0_20\bin\javaw

Regarding the ini file, it depends on the full contents. What does your ini file contains?

关于ini文件,它取决于完整的内容。你的ini文件包含什么?

#6


2  

Put these lines at the beginning of the eclipse.ini file:

将这些行放在eclipse的开头。ini文件:

-vm
G:/dev/jdk1.6.0_19/bin/javaw.exe

#7


1  

I'm getting the same error message as soon as I remove these two lines

当我删除这两行代码时,我将得到相同的错误消息。

-vm
C:\Programme\Java\jdk1.6.0_10\bin\javaw.exe

from my eclipse.ini file. Maybe you should use backslashes in that eclipse.ini.

从我的eclipse。ini文件。也许你应该在eclipse.ini中使用反斜线。

#8


0  

There are two JVMs involved here; the one that Eclipse is running in and the one (or more) that the different projects in your workspace run in. I think this message refers to the JVM that Eclipse is running in. So, the solution is not contained in the "Installed JREs" section within Eclipse. It's the JVM that's in your path within Windows.

这里涉及两个jvm;Eclipse正在运行的一个和一个(或多个)在您的工作区中运行的不同项目。我认为这个消息是指Eclipse正在运行的JVM。因此,解决方案不包含在Eclipse中“安装的JREs”部分中。它是在窗口内的路径中的JVM。

#9


0  

Java may be finding its files using the JAVA_HOME environment variable. Try changing it to C:\Programme\Java\jdk1.6.0_20

Java可能正在使用JAVA_HOME环境变量查找其文件。试着把它改到C:\ \Java\jdk1.6.0_20。

In Windows XP, this is under Control Panel, System, Advanced tab, Environment Variables button.

在Windows XP中,这是在控制面板,系统,高级选项卡,环境变量按钮。

#10


0  

Uninstall the JRE leaving ONLY the JDK and private JRE behind. Run Eclipse, and it will immediately complain that it can't find a JRE or JDK (assuming the -vm option is missing or wrong in your ini).

卸载JRE只留下JDK和私有JRE。运行Eclipse,它会立即抱怨它找不到JRE或JDK(假设-vm选项在您的ini中丢失或错误)。

Now put the -vm path to javaw in your ini file, save and Eclipse will now load the JDK.

现在将-vm路径放到ini文件中,保存和Eclipse将加载JDK。

I actually went ahead and uninstalled everything Java and then reinstalled JDK 6 leaving out the public JRE and the database portion of the install.

实际上,我先卸载了Java,然后重新安装JDK 6,省去了公共JRE和安装的数据库部分。

#11


0  

The uninstall method is the only thing that worked for me. No amount of -vm magic made it happen until I only had the JDK installed.

卸载方法是我唯一有效的方法。在我只安装JDK之前,没有任何数量的vm魔法。

#12


0  

I had the same problem but solved it. Add the -vm option as the first line in your eclipse.ini file and it will work.

我有同样的问题但解决了。在eclipse中添加-vm选项作为第一行。ini文件,它会工作。

#13


0  

Try adding this:

尝试添加:

-vm E:\java\jdk1.6\jre\bin\client\jvm.dll

#14


0  

I too had this issue. This problem disappeared when I upgrade to Eclipse Indigo. So try with Higher version.

我也有这个问题。当我升级到Eclipse Indigo时,这个问题就消失了。所以试着用更高的版本。

#15


0  

Check your Installed JRE setting of Eclipse. It should point to JDK rather than JRE. Though it is a JRE setup. Remember JDK contains JRE and when Maven runs it tries to find out JDK mostly tools.jar.

检查安装的Eclipse JRE设置。它应该指向JDK而不是JRE。虽然它是一个JRE设置。记住,JDK包含JRE,当Maven运行时,它试图找出JDK的主要工具。