I want to open all the .java files with Eclipse to edit instead of gedit. I tried the open with menu but eclipse isn't listed there. How to I get this done? I'm using Ubuntu Gnome 13.04 edition. I have not installed Eclipse using apt-get but have downloaded eclipse as a part of ADT-BUNDLE (Tools for Android Development).

I would like to a general method to select other program for running a file that is not listed in Other Applications as there is an option in Windows for browse to any other program.

  • Do you have Eclipse installed using apt-get or you downloaded the package from the webpage? – Leo Jun 28 '13 at 16:28
  • @LeopoldoPla I edited the post so that it's visible to all – meteors Jun 28 '13 at 16:33

In terminal write:

gksudo gedit /usr/share/applications/eclipse.desktop

Then paste and modify this text:

[Desktop Entry]
Comment=Configurable and extensible IDE
Exec=/opt/eclipse/eclipse %F

Save and close the file. If needed modify Exec and Icon paths, according to where you have Eclipse executable and its icon. I have it in /opt/eclipse. You need to leave %F after exec path.

After it's done, right-click desired file and choose open with (or something similar). Find eclipse and it's done.

More details: Add Program to List of Applications in “Open With” When Right-Clicking Files in Nautilus.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.