This one has confused me for a couple of hours.
I know the command sudo chmod +x file to give executable permissions, and still I don't get my application to run.
For context, I installed Eclipse manually and in the /opt/ folder. I created a link to /usr/bin/ and a /usr/share/applications/eclipse.desktop file with the data to start from the launcher.
When I run sudo eclipse the program starts normally, but if I don't includo sudo then it gives me an error. I tried giving permissions via chmod +x to all of the above, but I still get the error if I don't includo sudo.
This may be either a permission issue or an Eclipse issue. There is an error for Permission denied, and also the message
The Eclipse executable launcher was unable to locate its companion shared library.Hope someone can point me in the right direction.
22 Answers
A full step by step guide:
Remove your Eclipse installation
sudo rm -r /opt/eclipse sudo rm /usr/share/applications/eclipse.desktop sudo rm /usr/bin/eclipseDownload eclipse here, eg. Eclipse IDE for Java EE Developers 64-bit.
cd wgetExtract the archive
sudo tar xf eclipse-jee-mars-R-linux-gtk-x86_64.tar.gz -C /optCreate a desktop file
nano ~/.local/share/applications/eclipse.desktopand add the configuration below
[Desktop Entry] Encoding=UTF-8 Version=1.0 Type=Application Name=Eclipse JEE Comment=Eclipse Integrated Development Environment Icon=eclipse Exec=/opt/eclipse/eclipse StartupNotify=true StartupWMClass=Eclipse-JEEIcon=eclipsetakes the icon from your icon theme, if there is one. If not, use an absolute icon path.Start eclipse via your launcher
In my case the diagnostics of the error The Eclipse executable launcher was unable to locate its companion shared library. was clear:
/root/.p2/pool/plugins org.eclipse.equinox.launcher.gtk.linux.x86_64_1.1.401.v20161122-1740: cannot open shared object file: Permission denied.
This is because I launched the eclipse installer with the sudo rights for getting access to /opt, where I wanted eclipse to be. As result, the installer placed a bunch of plug-ins under /root by some defaults of its own.
However, I circumvented this by
- creating an
/opt/eclipsesubdirectory that I owned. Say withsudo mkdir /opt/eclipse && sudo chown -R user:user /etc/eclipse(substituteuserwith your user name). - launching
eclipse-installernormally without sudo rights and having it finish its task - reverting the ownership
sudo chown -R root:root /etc/eclipse.
In the end I could start eclipse from the executable within that tree without sudo and without protest.
Have a look at for more context on this approach.