How to give permission to execute Eclipse application?

16,941

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 https://eclipse.org/downloads/download.php?file=/technology/epp/downloads/release/mars/R/eclipse-jee-mars-R-linux-gtk-x86_64.tar.gz
    
  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

Share:
16,941

Related videos on Youtube

Diego-MX
Author by

Diego-MX

Updated on September 18, 2022

Comments

  • Diego-MX
    Diego-MX over 1 year

    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.

    • Admin
      Admin over 8 years
      Just FYI, one should never run graphical applications such as Eclipse using sudo. If it needs root permissions, you should use gksudo instead for avoiding to mess up permissions of your home directory. And you also have to know that if Eclipse runs as root, the programs you write and start with it run as root as well, which is most probably not desired and can be dangerous! Use root access as rarely as possible.
    • Admin
      Admin over 8 years
      Good to know. It did feel weird to have to start it like that, but then there's more issues that I wasn't aware of.
  • Diego-MX
    Diego-MX over 8 years
    Yup, this did it. Using that installer had me go through a lot more. Thanks.
  • Byte Commander
    Byte Commander over 8 years
    @Diego If this answer solved your problem, don't forget to accept it.
  • Diego-MX
    Diego-MX over 8 years
    Minor details: the icon didn't work as such, it's location is opt/eclipse/icon.xpm, the current version is 4.5.0.
  • Christine
    Christine over 7 years
    The wget didn't work for me, but I managed to download the file from the site. This oomph installer just doesn't work, although on another computer, a few weeks ago, it did.
  • XavierStuvw
    XavierStuvw over 7 years
    @Diego I converted the xpm into a jpg and it worked for me. Try convert icon.xpm icon.jpg