在eclipse.ini中设置-vm

在安装了m2eclipse插件后,启动eclipse总是会在"initializing java tooling"时报一个Warning,这是因为Maven的一些核心插件需要jdk中的jar,提示要让eclipse.ini中-vm选项指向一个已安装的jdk并且eclipse中Installed JREs也要指向已安装的jdk目录。
按照要求解决方法如下:
1. 在eclipse.ini中添加两行
    -vm
    C:\Program Files\Java\jdk1.6.0_02\bin\javaw.exe
    注意: 要写在两行,写在一行不能生效
    注意: 这两行要定在-vmargs之前,不然也不能生效

2. Eclipse--Windows--Preferences--Java--Installed JREs将JRE home改成jdk目录
 
 
经试验发现第2步可以不做,而且第一步的两行也可以写成
     -vm
    C:\Program Files\Java\jdk1.6.0_02\bin\

原文位置: http://my.oschina.net/caiyuan/blog/14359

vm选项的含义: http://help.eclipse.org/indigo/index.jsp?topic=/org.eclipse.platform.doc.user/tasks/running_eclipse.htm

Specifying the Java virtual machine

Here is a typical Eclipse command line: 

eclipse -vm c:\jdk1.4.2\jre\bin\javaw

Tip: It's generally a good idea to explicitly specify which Java VM to use when running Eclipse. This is achieved with the "-vm" command line argument as illustrated above. If you don't use "-vm", Eclipse will look on the O/S path. When you install other Java-based products, they may change your path and could result in a different Java VM being used when you next launch Eclipse.



你可能感兴趣的:(java,eclipse,jdk,maven,eclipse插件,command)