当前位置: 代码迷 >> Eclipse >> Eclipse安装Maven插件后,Eclipse启动有关问题:Maven Integration for Eclipse JDK Warning
  详细解决方案

Eclipse安装Maven插件后,Eclipse启动有关问题:Maven Integration for Eclipse JDK Warning

热度:741   发布时间:2016-04-23 02:21:34.0
Eclipse安装Maven插件后,Eclipse启动问题:Maven Integration for Eclipse JDK Warning。
1. 设置Eclipse使用的JRE为本机安装的JDK目录:
??? 1.1 在eclipse.ini中添加两行

??? -vm

??? C:Program FilesJavajdk1.6.0_10injavaw.exe

??? 注意: 要写在两行,写在一行不能生效;

??????????? 这两行要定在-vmargs之前,不然也不能生效。

?? 1.2? 或设置Eclipse--Windows--Preferences--Java--Installed JREs将JRE home改成jdk目录。

?? 经试验发现第1.2步可以不做,但建议配置开发环境是配置着一步,而且第一步的两行也可以写成

??? ?-vm

??? C:Program FilesJavajdk1.6.0_10in

?

?

Run Eclipse with a JDK

Maven requires Eclipse using a JDK, i.e. Java Development Kit,?instead of a Java Runtime Environment (JRE). The main difference is that a JDK also contains a Java Compiler and other tools to develop Java Code, while the JRE is only able to run compiled Java applications.

To check with what Java version (JRE or JDK) Eclipse is running, do the following:

  • Open the menu item "Help > About Eclipse". (On the Mac, it's in the Eclipse-menu, not the Help-menu)
  • Click on "Installation Details".
  • Switch to the tab "Configuration"
  • Search for a line that starts with "-vm". The line following it shows which Java binary is used.

Depending on the name and location of the used Java binary one can figure out if a JRE or a JDK is used:

  • If the path contains "jre" (e.g. as in C:\Program Files\Java\jre6\bin\client\jvm.dll) it is a JRE
  • If the path contains "jdk" (e.g. as in C:\Program Files\Java\jdk1.6.0_17\bin\javaw.exe) it is a JDK.

????? If no JDK is used for eclipse, change it:

  • Quit Eclipse if it is running
  • Go to the eclipse installation directory and open the file eclipse.ini in a text editor.
  • Search for the line "-vmargs"
  • Before?the line "-vmargs", add two lines:
    On the first line, write "-vm".
    On the second line, write the path to your JDK installation (usually something like: "C:\Program Files\Java\jdk1.6.0_17\bin\javaw.exe" on Windows)

?

?

2. 配置eclipse.ini文件:
??? 先解释该文件-vmargs下常见参数的意思:
??? -vmargs
??? -Xms40m
??? -Xmx256m
??? -XX:PermSize=64M
??? -XX:MaxPermSize=128M
???
??? -vmargs:说明后面是VM的参数
??? -Xms40m:虚拟机占用系统的最小内存
??? -Xmx256m:虚拟机占用系统的最大内存
??? -XX:PermSize:最小堆大小。一般报内存不足时,都是说这个太小, 堆空间剩余小于5%就会警告,建议把这个稍微设
????????????????????????????大一点,不过要视自己机器内存大小来设置,但不能超过MaxPermSize。
??? -XX:MaxPermSize:最大堆大小。这个也适当大些所以若出现问题,首先请调整 -Xms40m:将其设置的小一些,
??????????????????????????? 就 可以解决问题。
http://www.matsim.org/book/export/html/364
  相关解决方案