`

eclipse.ini解释

    博客分类:
  • Java
 
阅读更多

大多数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配置

    eclipse.ini配置推荐(8or16GB)Java堆内存详解eclipse运行速度慢或者卡的时候有多方面、其中一方面可以通过更改eclipse.ini来更改 如下是我的eclipse.ini的相关配置、以及后面的详细说明 机器物理内存16GB (8G内存...

    eclipse.ini

    Eclipse的启动由$ECLIPSE_HOME/eclipse.ini控制,如果$ECLIPSE_HOME 没有被定义,则Eclipse安装目录下的默认eclipse.ini会生效。 eclipse.ini是一个文本文件,其内容相当于在Eclipse运行时添加到 Eclipse.exe之后的...

    eclipse.ini失败例子

    eclipse.ini失败例子,eclipse.ini失败例子

    eclipse.ini内存设置各参数含义

    在深入探讨《eclipse.ini内存设置各参数含义》这一主题之前,我们首先应当明确eclipse.ini文件在Eclipse集成开发环境中的重要性及其如何通过调整内存配置参数来优化Eclipse的运行性能。以下是对该主题的详细解析: ...

    Eclipse启动故障全攻略:"Eclipse.ini配置错误"深度解析与修复

    Eclipse 是一个开放源代码的、可扩展的集成开发环境(IDE)。最初由 IBM 公司开发,后来由 Eclipse 基金会管理,Eclipse 支持多种编程语言,包括 Java、C/C++、Python 等,并且可以通过插件扩展支持更多语言和开发...

    eclipse.zip(---)

    对于Linux或Mac用户,相应的启动脚本可能为"eclipse"或"eclipse.ini"。 Eclipse的配置可以根据个人喜好和项目需求进行调整。例如,可以在"eclipse.ini"文件中修改JVM参数,以优化性能或增加内存分配。此外,通过...

    org.eclipse.paho.ui.app-1.0.0-win32.win32.x86_64.zip

    2. **eclipsec.exe**:可能是一个轻量级的Eclipse IDE版本,用于开发和调试基于Paho的MQTT应用。Eclipse IDE是Java开发的首选平台,也支持其他语言。 3. **paho.ini**:这是配置文件,可能包含了默认的连接设置,如...

    org.eclipse.paho.ui.app-1.0.2-win32.win32.x86_64.zip

    3. **paho.ini**:配置文件,用于存储用户的个性化设置和工具的初始配置信息。 4. **artifacts.xml**:Eclipse插件系统中的元数据文件,描述了插件的依赖关系和安装信息。 5. **p2**:Eclipse的更新管理器目录,用于...

    eclipse下ini设置详情

    Eclipse的运行需要Java虚拟机(JVM)的支持,而其配置文件eclipse.ini主要用于定义Eclipse启动时JVM的各种参数。在Ubuntu系统下,eclipse.ini文件的存放位置一般位于用户目录下的eclipse文件夹内。以下是对eclipse....

    org.eclipse.paho.ui.app.7z

    3. **paho.ini**:这可能是一个配置文件,包含了Eclipse Paho应用程序的初始设置,如MQTT服务器的URL、身份验证信息等。 4. **artifacts.xml**:这是Eclipse插件系统的元数据文件,描述了插件的组件和依赖关系。 5. ...

    基于eclipse.ini内存设置的问题详解

    Eclipse通过配置文件eclipse.ini来设置Java虚拟机(JVM)的内存参数,从而达到提高开发效率和避免内存溢出的目的。本文将详细探讨eclipse.ini中常见的内存设置问题,包括参数含义、内存分配、以及如何正确设置。 1....

    MQTT 客户端 测试工具(eclipse.paho )中文版

    - `paho.ini`:客户端的配置文件,可以设置服务器信息、认证凭据等。 - `artifacts.xml`:Eclipse项目相关的元数据文件,记录了项目组件的信息。 - `p2`:Eclipse的更新管理器目录,用于软件的安装和更新。 - `...

    android requiringorg.eclipse.wst.sse.ui

    8. **检查Eclipse.ini配置**:如果问题依然存在,可能需要检查Eclipse的启动配置文件(eclipse.ini),确保其中的内存分配足够运行Eclipse及其所有插件。 9. **论坛求助**:如果以上步骤都无法解决问题,可以到...

Global site tag (gtag.js) - Google Analytics