How to put executable to /usr/bin?
Just run eclipse
and it will start. There is no need to run it with sudo
. The update-alternatives --install
made soft link needed to launch Eclipse. That's the purpose of this tool.
However, if you install Eclipse from Software Center, it may override this link, so it is better to place it in /usr/local/bin
. This directory has priority when executing commands by default.
Other solution is to manually sudo ln -s /opt/eclipse/eclipse /usr/local/bin
. Notice that I'm using /usr/local
prefix because it's more appropriate in this case.
UPD: It seems something wrong went while you was unpacking Eclipse. The execution bit has gone. To restore it, you need to run:
sudo chmod +x /opt/eclipse/eclipse
Related videos on Youtube
Deepen
Updated on September 18, 2022Comments
-
Deepen over 1 year
I downloaded eclipse and extracted it to
/opt
.My question is how can I make it run from terminal as like other programs like javac, java. I did with
update-alternatives
as follows:sudo update-alternatives --install "/usr/bin/eclipse" "eclipse" "/opt/eclipse/eclipse" 1
I didn't get any error. I traversed and saw
/usr/bin/eclipse
was there, So I did:sudo eclipse
and I got:
sudo: eclipse: command not found
- Is this possible to execute command
eclipse
and my eclipse would start? - How can I make my User Program as one of the executable programs from terminal?
- Am I using
update-alternatives
for correct purpose? - Any other solution?
- Is this possible to execute command
-
Deepen about 10 yearsI did sudo ln -s /opt/eclipse/eclipse /usr/local/bin it was fine. Later I did sudo eclipse still same error & I know in this case it isn't neccessary to place it in /usr/bin or /usr/bin/local but wanted to learn. :)
-
terdon about 10 years@DpN just don't use
sudo
. There is no reason for it and that is what is causing the problem. -
Deepen about 10 yearsOn using only eclipse command its replying this bash: /usr/local/bin/eclipse: Permission denied
-
Danatela about 10 years@DpN Use
sudo chmod +x /opt/eclipse/eclipse
then runeclipse
. -
Deepen about 10 years/opt/eclipse/plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.1.200.v20140116-2212/eclipse_1508.so: cannot open shared object file: Permission denied
-
Deepen about 10 yearsGot this error after doing your last comment
-
Danatela about 10 years@DpN Can you reinstall Eclipse into
/opt/eclipse
? It seems you done something wrong. -
Deepen about 10 years@Danatela SOLVED user didnt had permission. I solved it. with this...sudo chmod -R deepen:deepen /opt/eclipse then sudo chmod -R u+rw+x /opt/eclipse & it worked & also learned! :) thank you!