3

I installed a program and I want to create a shortcut.

e.g. I want to type eclipse into the terminal to launch the program.

I already copied the eclipse folder in /home/user/Programs and created a symbolinc link to the executable /home/user/Programs/eclipse/eclipse (the one that allows me to launch the program by typing ./eclipse, I guess it is a binary or like a shell script) in a folder located in /home/bin and I added this last folder to the path using export.

But I have this issue:

bash: ./eclipse: No such file or directory

Can you please help me on that? I am sure that I missed something

amc
  • 7,022
  • 7
  • 39
  • 51
Nabil3oss
  • 31
  • 1
  • 1
  • 2
  • You may want to check the current path with `echo $PATH`. Also, what's /home/bin? – mikewhatever Aug 11 '15 at 20:57
  • AFAIK only binaries that are in your `$PATH` folders are readily executed by typing them into the terminal; but binaries in subfolders cannot be executed. Check your `echo $PATH` and compare that with `which eclipse` commands. If your eclipse binary is in a subfolder, say `/usr/bin/eclipse` you will need to add `/usr/bin/eclipse` to your `$PATH` as well. Let me know if this helps – Sergiy Kolodyazhnyy Aug 12 '15 at 00:20
  • 3
    possible duplicate of [How can I run this sh script without typing the full path?](http://askubuntu.com/questions/427818/how-can-i-run-this-sh-script-without-typing-the-full-path) – muru Aug 12 '15 at 04:57

2 Answers2

4

You can use alias also. Add below line to the ~/.bashrc file.(gedit ~/.bashrc command will open file for the editing.) Then close and open a terminal.

alias eclipse='/home/<user>/Programs/eclipse/eclipse'

Then type eclipse to open Eclipse. You don't need ./ at the begining of the command.

dedunu
  • 8,986
  • 4
  • 22
  • 28
3
sudo ln -s /home/<user>/Programs/eclipse/eclipse /usr/bin/eclipse

Preplace <user> with your username

Troy
  • 51
  • 3