5

I can't launch eclipse from either terminal or gmrun but I can do so using Applications -> Programming -> Eclipse.

Here are the screenshots:

1) Using Gmrun: I can see that gmrun is recognizing the eclipse command but when I enter it, nothing happens.

enter image description here

2) Using Terminal: when I type eclipse, I get the following message:

terminal

Thanks!

javanoob
  • 969

4 Answers4

8

Ubuntu has its own directories from which it will check for applications (like /usr/bin). So If you just downloaded eclipse to /opt then of course it won't be recognized. If you want it to be recognized, you have two options, either install from Ubuntu standard repos (with disadvantage missing latest version) or install your eclipse on those directories / symlink it (both unrecommended).

BTW why not cd /opt/eclipse and just run ./eclipse?

Eliah Kagan
  • 117,780
  • I want to able to run eclipse from run dialog box..You think thats not possible with current setup? – javanoob Sep 30 '11 at 13:28
  • You have to add symlink that will pretend as if eclispe runs from "system" directories. For example you can create symlink of eclipse executable in /usr/local/eclipse. For more on symlinks check http://www.unixtutorial.org/2008/02/unix-symlink-example/ – Stefano Mtangoo Sep 30 '11 at 17:09
  • @Stefano These are not the only two options. As lol xD's answer details, you can add the directory that contains the eclipse binary to the PATH environment variable. This method is quite standard, quick, and elegant. – Eliah Kagan Aug 10 '12 at 22:36
  • You are right! I think finding a PPA with latest eclipse version might be better option. I remember one time I saw it somewhere! – Stefano Mtangoo Aug 13 '12 at 09:11
2

Do the following steps to fix it. Assume you extracted eclipse in /opt/eclipse. Your eclipse executable's path is /opt/eclipse/eclipse

Fix permission

sudo chmod -R a+x /opt/eclipse

Make a link of eclipse (executable)

sudo ln -s /opt/eclipse/eclipse /usr/local/bin/eclipse

Again fix the permission

sudo chmod a+x /usr/local/bin/eclipse

Check in terminal to ensure that system detects eclipse which eclipse

output: /usr/local/bin/eclipse

Now you can run eclipse by typing eclipse in terminal or search in gmrun (ATL+F2)

shantanu
  • 8,599
1

Or maybe you could try to change your $PATH environment variable in the .profile file in your home directory? Like adding a line export PATH=$PATH:/opt/eclipse to the file (at or near the end of the file).

Eliah Kagan
  • 117,780
lol xD
  • 11
0

You can do the following:

open ~/.bashrc with your favourite editor and add the following lines to the end of the file:

if [ -d "/opt/eclipse" ] ; then
    PATH="/opt/eclipse:$PATH"
fi

Close and open the terminal.

This is what I did in Unity and it worked for me. I am not quite sure if it will work on the Gnome environment.

und3rd06012
  • 1,449
  • 3
  • 27
  • 41