Unity – Aggiungi link all’eseguibile in /opt

Place the installation to a common area (/opt).

$ sudo mkdir /opt/eclipse
$ sudo mv  /home/USERNAME_HIDDEN/eclipse/java-neon/ /opt/eclipse/

make a common link to the eclipse program to /usr/local/bin/eclipse.

$ sudo ln -s /opt/eclipse/eclipse /usr/local/bin/eclipse

Test running eclipse from the commandline.. Type this without a path:

$ eclipse

If it doesn’t work the exec program might be at:

/opt/eclipse/eclipse/eclipse

Fix this by removing the previous link and linking the exec with:

$ sudo rm /usr/local/bin/eclipse
$ sudo ln -s /opt/eclipse/eclipse/eclipse /usr/local/bin/eclipse

When you can bring up Eclipse from the commandline, you can make a desktop entry by creating a desktop program with.

Create the GUI Launcher

$ gedit  /home/USERNAME_HIDDEN/.local/share/applications/eclipse.desktop

copy and paste this into the editor then save it:

[Desktop Entry]
Version=1.0
Type=Application
Terminal=false
Name=Eclipse
Exec=/usr/local/bin/eclipse
Comment=Eclipse Integrated Development Environment
Icon=/opt/eclipse/eclipse/icon.xpm
Categories=programing;IDE;utility

Now eclipse should appear in your Ubuntu Launcher search button.