Where does Eclipse look for eclipse.ini under Linux

LinuxEclipseUbuntu

Linux Problem Overview


I've just been setting up a Ubuntu workstation and wanted to add some settings to eclipse.ini. When I searched for the file I found:

  • /etc/eclipse.ini
  • /usr/lib/eclipse.ini

My questions are:

  • Does Eclipse actually use both files?
  • If so, in what order does it read them?
  • How does it merge them?
  • Both of the files I found are system wide, is there a location in my home directory I could put one that would effect only my instances?

Linux Solutions


Solution 1 - Linux

There is only one file.

> lrwxrwxrwx 1 root root 16 Aug 8 2012 /usr/lib/eclipse/eclipse.ini -> /etc/eclipse.ini

Solution 2 - Linux

Here's how to determine which eclipse.ini file you should use (joomla.org):

  • If you downloaded Eclipse IDE manually from internet the "eclipse.ini" file is just inside the unpacked folder
  • If you installed Eclipse via terminal or software center the location of the file is "/etc/eclipse.ini"
  • In some Linux versions the file can be found at "/usr/share/eclipse/eclipse.ini". Do not use this file if you found a config file at "/etc/eclipse.ini".

To be sure where your Eclipse folder is, check $ECLIPSE_HOME, and if not specified (these directions at least work for Juno):

  • Open Eclipse as you normally do.
  • Click Help -> About Eclipse SDK
  • Click Installation Details
  • Go to the Configuration tab
  • Find "eclipse.home.location=file:PATH". PATH is where eclipse is installed.

sources:

Solution 3 - Linux

You probably have already found this out, chances are when you installed Eclipse the installation created (or you did manually) a file /usr/bin/eclipse which if you check it probably looks like the following:

#!/bin/sh
export ECLIPSE_HOME="/opt/eclipse"
 
$ECLIPSE_HOME/eclipse $*

especially if you followed instructions similar to the ones like these on If-not-true-then-false

On the other hand if you have installed from a package, I suspect you will find that eclipse ends up in /usr/bin, most likely a symbolic link to /usr/lib/eclipse/eclipse (or at least I found it on my Fedora system after using yum to install eclipse).

Solution 4 - Linux

I have Ubuntu 18 and eclipse installation is squashed in a file

> /var/lib/snapd/snaps/eclipse_40.snap

which is mount on /snap/eclipse/40 as read only. Just run

mount | grep eclipse*.snap

This eclipse.ini file is really read only, that means, you cannot modify it, even with sudo. However, I also have a eclipse.ini.ignored file in HOME/.eclipse/some number/configuration. This is being by default ignored, but you can change the "launcher.ini" in the eclipse launcher command.

Solution 5 - Linux

According to https://wiki.eclipse.org/Eclipse.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, the Eclipse.app/Contents/MacOS directory) is used.

Solution 6 - Linux

The certain way to make sure is to run strace on eclipse. In the output you'll see where is eclipse actually trying to pull the file from.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionJon StrayerView Question on Stackoverflow
Solution 1 - LinuxJon StrayerView Answer on Stackoverflow
Solution 2 - LinuxAlexander TaylorView Answer on Stackoverflow
Solution 3 - Linuxuser2069626View Answer on Stackoverflow
Solution 4 - LinuxfairtraxView Answer on Stackoverflow
Solution 5 - Linuxjharig23View Answer on Stackoverflow
Solution 6 - LinuxVladimirView Answer on Stackoverflow