While we believe that this content benefits our community, we have not yet thoroughly reviewed it. If you have any suggestions for improvements, please let us know by clicking the “report an issue“ button at the bottom of the tutorial.
eclipse.ini is the configuration file used to control the Eclipse startup. We can configure Eclipse VM arguments such as JDK to be used (eclipse.ini vm), permgen space, maximum and minimum heap size using Xms, Xmx parameters.
For windows, it’s in the same directory as eclipse.exe file, as shown in below image. For Mac OS X, it’s found inside the app. So if Eclipse app is in Downloads directory, eclipse.ini file location will be:
pankaj$ cd ~/Downloads/Eclipse.app/Contents/Eclipse/
You can reach this location by first right clicking on Eclipse app and click on “Show Package Contents” and then in the next window navigate to
Contents/Eclipse directory, as shown in below images. Here is the example eclipse.ini file from my default eclipse installation.
-startup ../Eclipse/plugins/org.eclipse.equinox.launcher_1.3.100.v20150511-1540.jar --launcher.library ../Eclipse/plugins/org.eclipse.equinox.launcher.cocoa.macosx.x86_64_1.1.300.v20150602-1417 -product org.eclipse.epp.package.jee.product --launcher.defaultAction openFile -showsplash org.eclipse.platform --launcher.XXMaxPermSize 256m --launcher.defaultAction openFile --launcher.appendVmargs -vmargs -Dosgi.requiredJavaVersion=1.7 -XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts -XX:MaxPermSize=256m -Xms256m -Xmx1024m -Xdock:icon=../Resources/Eclipse.icns -XstartOnFirstThread -Dorg.eclipse.swt.internal.carbon.smallFonts
Some important points about eclipse.ini file are:
eclipse.ini vm argument is useful when you have multiple JDK installation and you want to make sure that your eclipse runs on a specific JVM, rather than picking system configured jdk path. It must be defined before -vmargs.
My eclipse.ini file snippet showing -vm argument usage to configure eclipse to use JDK8 in Mac OS X.
-vm /Library/Java/JavaVirtualMachines/jdk1.8.0_73.jdk/Contents/Home/bin -vmargs
You can configure it similarly for Windows or Linux operating systems. Just change the JDK bin directory path accordingly.
If you are getting
java.lang.OutOfMemoryError: PermGen space error, mostly when you are working on larger code base, doing maven update for large projects etc. , then you should increase Permgen space. Below is the configuration to increase permgen space to 512 MB in eclipse.ini file.
Note that there is no more Permgen space from Java 8 onwards, so setting this option will have no effect. However you will also not get out of memory error because of permgen space.
If you are getting OutOfMemoryError related to Heap space, then you can try to increase the maximum heap size available to eclipse. You can easily do it by editing -Xmx value. For example, below snippet will increase the eclipse heap size to 2 GB.
That’s all for a quick roundup on eclipse.ini configuration and VM arguments.
Thanks for learning with the DigitalOcean Community. Check out our offerings for compute, storage, networking, and managed databases.