eclipse装上maven后老是报一个找不到jdk的错误

来源:互联网 发布:centos安装unzip 编辑:程序博客网 时间:2024/06/11 22:39

On 9/3/09 10:43 AM, Dan Grindstaff wrote:

Hello All, I have installed the maven plugin with eclipse and on startupit keeps complaining about runing in jre and not being able to fin jdk.I have modified my system and user environmental variables to includeJAVA_HOME pointing to the jdk, even added a variable to the projectJAVA_HOME pointing to the jdk but still maven complains. I cannot builda jar from the project. Any ideas are greatly appreciated. TIA.
以上是一位前辈遇到的问题,正好我也遇到同样的问题,就把它摘录下来。解决方法是修改eclipse.ini 配置文件,
把解决方案也原封不动的挪下来,以防忘记:

Specifying the JVM

One of the most recommended options to use is to specify a specific JVM for Eclipse to run on. Doing this ensures that you are absolutely certain which JVM Eclipse will run in and insulates you from system changes that can alter the "default" JVM for your system. Many a user has been tripped up because they thought they knew what JVM would be used by default, but they thought wrong. eclipse.ini lets you be CERTAIN.

The following examples of eclipse.ini demonstrate correct usage of the -vm option.

Note the format of the -vm option - it is important to be exact:

  • The -vm option and its value (the path) must be on separate lines.
  • The value must be the full absolute path to the Java executable, not just to the Java home directory.
  • The -vm option must occur before the -vmargs option, since everything after -vmargs is passed directly to the JVM.

Windows Example

-showsplashorg.eclipse.platform--launcher.XXMaxPermSize256m-vmC:/Java/JDK/1.5/bin/javaw.exe-vmargs-Xms40m-Xmx512m

Linux Example

On a Linux system, the file looks quite similar:

-showsplashorg.eclipse.platform--launcher.XXMaxPermSize256m-vm/opt/sun-jdk-1.6.0.02/bin/java-vmargs-Xms40m-Xmx512m
原创粉丝点击