m2eclipse: Eclipse is running in a JRE, but a JDK is required 博客分类: Java EclipseJDKmavenWindowsC
程序员文章站
2024-03-24 17:58:04
...
Eclipse 安装了Maven插件,启动Eclipse 后,提示错误信息:
解决方法:
First… install JDK if you don’t have it.
And then…
set your JDK as a default Java environment in eclipse (default installed JRE)
Open eclipse. Click on ‘Window’ -> ‘Preferences’ -> ‘Java’ -> ‘Installed JREs’.
If you can’t find any JDK on the list -> click ‘Add’ -> ‘Standard VM’ -> set all paths and click ‘Finish’.
After that – check this JDK on the list of installed JREs and click ‘OK’.
add path to your SDK in eclipse.ini
open ‘eclipse.ini’ and add there:
1
2
3
4
|
-vm
path_to_javaw_on_your_machine
<
pre
>
|
so in my example it will be (jdk1.6.0_17 on Windows):
1
2
3
|
-vm
C:\Progra~1\Java\jdk1.6.0_17\jre\bin\javaw
|
Notice 1: Do not use paths with spaces!
Replace all dir names with spaces to their shortcuts. For example: ‘Program Files’ is ‘Progra~1′.
Notice 2: ‘-vm’ is in the first line, path is in the second line
My full ‘eclipse.ini’ looks like this:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
-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
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
-vm
H:\Progra~1\Java\jdk1.6.0_17\jre\bin\javaw
-vmargs
-Xms40m
-Xmx256m
|