How to make Eclipse installed via snap use a differerent configuration when started from global menu

There are many possible solutions but the my favorite/simplest one is to use Menulibre:

  1. Copy /snap/eclipse/current/eclipse.ini to somewhere you can edit it. Let us say, copy it to /etc/eclipse.ini.

  2. Edit the arguments you want to update[1] and save the file.

  3. Open Menulibre[2]

  4. Search for "Eclipse."

  5. Click in the Eclipse icon.

  6. In the "Command" input, add the --launcher.ini option after the binary path. In our example, we would replace

     /snap/bin/eclipse %U
    

    with

     /snap/bin/eclipse  --launcher.ini /etc/eclipse.ini %U
    
  7. Click in Menulibre's "Save" button. I have only tested it on Unity and MATE, though, not sure it is going to work with GNOME 3.

So far, it is working to me.


Notes

[1] I, for example, changed

    -Xms
    256m
    -Xmx
    1024m

to

    -Xms
    1024m
    -Xmx
    4096m

[2] You may have to install it. A way to do it is to use APT:

$ sudo apt-get install menulibre