Chinaunix首页 | 论坛 | 博客
  • 博客访问: 2537405
  • 博文数量: 245
  • 博客积分: 4125
  • 博客等级: 上校
  • 技术积分: 3113
  • 用 户 组: 普通用户
  • 注册时间: 2009-03-25 23:56
文章分类

全部博文(245)

文章存档

2015年(2)

2014年(26)

2013年(41)

2012年(40)

2011年(134)

2010年(2)

分类: Java

2011-11-04 10:47:05

From:Overview

Eclipse startup is controlled by the options in $ECLIPSE_HOME/eclipse.ini. If $ECLIPSE_HOME is not defined, the defaulteclipse.ini in your Eclipse installation directory is used.

eclipse.ini is a text file containing command-line options that are added to the command line used when Eclipse is started up. There are many options available, please see here.

Important:

  1. Each option and each argument to an option must be on its own line.
  2. All lines after -vmargs are passed as arguments to the JVM, so all arguments and options for eclipse must be specified before -vmargs (just like when you use arguments on the command-line)

By default, eclipse.ini contains something like

  1. -showsplash
  2. org.eclipse.platform
  3. --launcher.XXMaxPermSize
  4. 256m
  5. -vmargs
  6. -Xms40m
  7. -Xmx256m

which sets the heap space to 40MB initially and a maximum of 256MB, and also specifies a maximum PermGen size of 256MB.

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
  1. -showsplash
  2. org.eclipse.platform
  3. --launcher.XXMaxPermSize
  4. 256m
  5. -vm
  6. C:\Java\JDK\1.5\bin\javaw.exe
  7. -vmargs
  8. -Xms40m
  9. -Xmx512m
Linux Example

On a Linux system, the file looks quite similar:

-showsplash org.eclipse.platform --launcher.XXMaxPermSize 256m -vm /opt/sun-jdk-1.6.0.02/bin/java -vmargs -Xms40m -Xmx512m Mac OS X Example

On a Mac OS X system, you can find eclipse.ini by right-clicking (or Ctrl+click) on the Eclipse executable in Finder, choose Show Package Contents, and then locate eclipse.ini in the MacOS folder under Contents.

To specify Java 6 for OS X:

-showsplash org.eclipse.platform --launcher.XXMaxPermSize 256m -vm /System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home/bin/java -vmargs -Xms40m -Xmx512m See Also



阅读(925) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~