当前位置:首页 > 开发 > 编程语言 > Eclipse > 正文

eclipse.ini解释

发表于: 2015-04-30   作者:BigBird2012   来源:转载   浏览:
摘要: 大多数java开发者使用的都是eclipse,今天感兴趣去eclipse官网搜了一下eclipse.ini的配置,供大家参考,我会把关键的部分给大家用中文解释一下。还是推荐有问题不会直接搜谷歌,看官方文档,这样我们会知道问题的真面目是什么,对问题也有一个全面清晰的认识。 Overview 1、Eclipse.ini的作用 Eclipse startup is controlled by th

大多数java开发者使用的都是eclipse,今天感兴趣去eclipse官网搜了一下eclipse.ini的配置,供大家参考,我会把关键的部分给大家用中文解释一下。还是推荐有问题不会直接搜谷歌,看官方文档,这样我们会知道问题的真面目是什么,对问题也有一个全面清晰的认识。

Overview

1Eclipse.ini的作用

Eclipse startup is controlled by the options in $ECLIPSE_HOME/eclipse.ini. If $ECLIPSE_HOME is not defined, the default eclipse.ini in your Eclipse installation directory (or in the case of Mac, theEclipse.app/Contents/MacOS 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.

2Important要注意的地方:

Each option and each argument to an option must be on its own line.

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)

Any use of -vmargs on the command-line replaces all -vmargs settings in the .ini file unless --launcher.appendVmargs is specified either in the .ini file or on the command-line. (doc)

3windows下设置的例子:

 

By default, eclipse.ini looks something like this (the exact contents will vary based on operating system and which Eclipse package you have):

 

-startup
../../../plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar
--launcher.library
../../../plugins/org.eclipse.equinox.launcher.cocoa.macosx.x86_64_1.1.100.v20110502
-product
org.eclipse.epp.package.jee.product
--launcher.defaultAction
openFile
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
-vmargs
-Dosgi.requiredJavaVersion=1.5
-XX:MaxPermSize=256m
-Xms40m
-Xmx512m

 Among other things, this sets the heap space to 40MB initially and a maximum of 512MB, and also specifies a maximum PermGen size of 256MB. A max heap of 512MB might be OK for some users, but it's often necessary to bump that value up for large project sets or when some third-party plugins are installed.

 

 

3Specifying the JVM 指定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 or relative 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.

For the 32-bit Eclipse executable (eclipse.exe on Windows) a 32-bit JVM must be used and for the 64-bit Eclipse executable a 64-bit JVM must be used. 32-bit Eclipse will not work with a 64-bit JVM.

 

Here is an example of what eclipse.ini might look like on a Windows system after you've added the -vm argument and increased the maximum heap space:

 

-startup
plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.100.v20110502
-product
org.eclipse.epp.package.java.product
--launcher.defaultAction
openFile
--launcher.XXMaxPermSize
256M
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
256m
--launcher.defaultAction
openFile
-vm
C:\Java\JDK\1.6\bin\javaw.exe
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xms40m
-Xmx1024m

      Remember that the exact values will differ slightly depending on operating system and Eclipse package.

  以下是WindowsLinuxMacOS下设置eclipse.ini的例子

4-vm value: Windows Example

 

This is how the -vm argument might look on Windows (your exact path to javaw.exe could be different, of course):

 

-vm
C:\jdk1.7.0_21\bin\javaw.exe 
An alternative way is to insert the following VM option before the -vmargs option in the Eclipse shortcut properties(edit the field Target inside the "Shortcut" tab):
-vm C:\jdk1.7.0_21\bin\javaw.exe
or
-vm C:\jdk1.7.0_21\jre\bin\java.exe

 This might not work on all systems. If you encounter "Java was started but returned exit code=1" error while starting the eclipse, modify the -vm argument to point to jvm.dll (exact path could be different):

 

 

 

-vm
C:\Development\Java\64bit\jdk1.7.0_09\jre\bin\server\jvm.dll

       5-vm value: Linux Example

This is how the -vm argument might look on Linux (your exact path to java could be different, of course):

-vm
/opt/sun-jdk-1.6.0.02/bin/java

 6-vm value: 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 underContents.

To specify Java 6 for OS X:

-vm
/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home/bin/java

 For versions of Mac OS X 10.7+ the location has changed to

/Library/Java/JavaVirtualMachines/<''jdk_name_ver''>/Contents/Home/...

 To be safer, determine the location for the JDK you intend to use via the utility /usr/libexec/java_home and put this value with .../bin/java appended into the Eclipse.ini file.

 原文地址:https://wiki.eclipse.org/Eclipse.ini

 

 

eclipse.ini解释

  • 0

    开心

    开心

  • 0

    板砖

    板砖

  • 0

    感动

    感动

  • 0

    有用

    有用

  • 0

    疑问

    疑问

  • 0

    难过

    难过

  • 0

    无聊

    无聊

  • 0

    震惊

    震惊

编辑推荐
这两天用eclipse,突然变得很卡,就上网找了些资料,对eclipse.ini启动参数配置,整理如下: 1.先了
1.先了解下JVM内存管理机制,JVM内存分为堆内存和非堆内存 2.JVM内存限制 首先JVM内存限制于实际的最
eclipse.ini内存设置 这两天用eclipse,突然变得很卡,就上网找了些资料,对eclipse.ini启动参数配
新工作,项目是ssnc综合服务平台,是一个有关农业的项目,挺好玩滴。 搭建Eclipse开发环境JDK和Jre
最近,Eclipse(Eclipse-JEE3.5)运行十分缓慢(可能插件安装过多),因此,得到了个机会调优一下,
【叫我小猫Frank|整理】eclipse.ini/myeclipse.ini文件中参数配置: -Xms,-Xmx,-PerSize 今天下午
最近,Eclipse(Eclipse-JEE3.5)运行十分缓慢(可能插件安装过多),因此,得到了个机会调优一下,
来自http://hi.baidu.com/timehandle/home 去年我做一个作业和调研的时候看了HOG的那篇论文,没怎么
[duī zhàn] 在计算机领域,堆栈是一个不容忽视的概念, 堆 栈是两种 数据结构。堆栈都是一种 数据
实战Makefile.am Makefile.am是一种比Makefile更高层次的规则。只需指定要生成什么目标,它由什么源
版权所有 IT知识库 CopyRight © 2009-2015 IT知识库 IT610.com , All Rights Reserved. 京ICP备09083238号