I recently installed eclipse the manual way. Extracting the file, setting up eclipse.desktop etc. It all works flawlessly. I also know it is possible to install eclipsee using sudo apt-get install eclipse-platform. If I use this method I can use the command eclipse in the terminal, and the program will start.

Now the manual way I used does not enable the eclipse-command in the terminal. Instead if I use eclipse-command it asks me to install eclipse from the Softwarecenter (sudo apt-get install eclipse-platform).

I wondered if there was some way of setting up a command like this to start eclipse? If so, can I do it for other programs like Apache-Maven mvn-command?

I don't want to use "aliases" because I cannot setup and eclipse alias, when "eclipse" is listed in the apt repository. It seems as if only if I install the eclipse from apt-get install I can start eclipse from a single command in the terminal.

I appreciate any help, and thanks in advance!

  • Yes, it is possible. You can use an alias for that. I think that there is an answer for this in other post. I'll search for it an let you know (you can also search around similar posts) – Lucio Nov 6 '13 at 21:18
  • Here it is :) – Lucio Nov 6 '13 at 21:23
  • but this doesnt work if the program is already listed in the apt repositories. – sleort Nov 6 '13 at 21:43
  • No because you won't need it. Did I misunderstand something? – Lucio Nov 6 '13 at 21:44
  • 2
    Are you sure that the alias doesn't work? Have you tried? – Lucio Nov 6 '13 at 22:11

You may be totally wrong when you say: "I cannot setup an eclipse alias, when "eclipse" is listed in the apt repository". That's because the sequence adopted by the BASH shell to search for how to execute your command is as follow:

  1. Before a command is executed REDIRECTION is done. Then following sequence used by SHELL
  3. Parameter expansion, command substitution, arithmetic expansion, and quote removal before being assigned to the variable
  4. Shell FUNCTION
  5. BUILTIN command
  6. HASH tables
  7. PATH variable
  8. If everything fails, you see command not found error message and if an appropriate packet exist in repositories, it will let you know.

Source: How BASH Shell Command Search Sequence Works.

So you can use all your aliases with confidence.

Anyway, here is a list of choices about how to "create a new terminal command" for eclipse:

  • Create a new alias:

    alias eclipse="/path/to/eclipse"

    Se also: How to create a permanent "alias"?

  • Create a new shell function called eclipse:

    eclipse () { /path/to/eclipse; }

    Add this function at the end of your ~/.bashrc file if you want to use it every time when you open the terminal.

  • Create a new bash script called eclipse:


    Save this script in your~/bin directory and don't forget to make it executable using the following command:

    chmod +x ~/bin/eclipse
  • Create a symbolic link for eclipse:

    sudo ln -s /path/to/eclipse /usr/bin/eclipse
  • Add /path/to/eclipse to your PATH environment variable (this answer):


    See also: How to add a directory to the PATH?

Now, the choice is yours!


You should add the directory where eclipse is to your path:


Editing your .bashrc file and adding that line at the end, should solve your issue. Restarting your terminal (ie. logging out, or opening another terminal) should allow you to verify your actions:

which eclipse

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.