Glam Prestige Journal

Bright entertainment trends with youth appeal.

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.

2

2 Answers

A full step by step guide:

  1. Remove your Eclipse installation

    sudo rm -r /opt/eclipse
    sudo rm /usr/share/applications/eclipse.desktop
    sudo rm /usr/bin/eclipse
  2. Download eclipse here, eg. Eclipse IDE for Java EE Developers 64-bit.

    cd
    wget 
  3. Extract the archive

    sudo tar xf eclipse-jee-mars-R-linux-gtk-x86_64.tar.gz -C /opt
  4. Create a desktop file

    nano ~/.local/share/applications/eclipse.desktop

    and 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-JEE

    Icon=eclipse takes the icon from your icon theme, if there is one. If not, use an absolute icon path.

  5. Start eclipse via your launcher

6

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/eclipse subdirectory that I owned. Say with sudo mkdir /opt/eclipse && sudo chown -R user:user /etc/eclipse (substitute user with your user name).
  • launching eclipse-installer normally 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.