??? -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)
?
?
??? -Xms40m
??? -Xmx256m
??? -XX:PermSize=64M
??? -XX:MaxPermSize=128M
??? -Xms40m:虚拟机占用系统的最小内存
??? -Xmx256m:虚拟机占用系统的最大内存
??? -XX:PermSize:最小堆大小。一般报内存不足时,都是说这个太小, 堆空间剩余小于5%就会警告,建议把这个稍微设
????????????????????????????大一点,不过要视自己机器内存大小来设置,但不能超过MaxPermSize。