Install eclipse in Ubuntu and create a desktop shortcut, ubuntueclipse
System: Ubuntu 16.04
JDK version: 1.8.0 _ 121
Install JDK under Ubuntu to configure environment variables to see my article http://www.cnblogs.com/AloneZ/p/Ubuntu1.html
1.The official website downloads eclipse, and my website is eclipse-jee-neon-2-linux-gtk-x86_64.tar.gz. As long as the JDK version is high, other versions can also be used.
2. Move and decompress the package to the/java directory.
Sudo mv eclipse-jee-neon-2-linux-gtk-x86_64.tar.gz/java // move to/java
Cd/java // enter the/java directory
Tar-zxvf eclipse-jee-neon-2-linux-gtk-x86_64.tar.gz // unzip
3. Run the command in the/java/eclipse directory.
./eclipse
If it is enabled properly, the installation is complete. If an error occurs, the jdk is not correctly configured.
However, it is very troublesome to run commands like this every time, but eclipse does not have a startup icon, so we will make
1. the UBuntu menu icon is saved in the/usr/share/applications directory. Therefore, create an eclipse. desktop file in this directory.
sudo gedit /usr/share/applications/eclipse.desktop
2. Enter the following content in the file:
[Desktop Entry] Encoding = UTF-8Name = Eclipse Platfrom // icon name, comment = Eclipse IDEExec =/java/eclipse // Eclipse path Icon =/java/eclipse/icon in the eclipse folder. xpm // Eclipse folder icon. xpm path Terminal = falseStartupNotify = trueType = ApplicationCategories = Application; Development;
3. Assign permissions to the file
chmod u+x /usr/share/applications/eclipse.desktop
4. The eclipse icon is displayed, and you can double-click it to run it. Copy it to the desktop.
NOTE: If jdk cannot be found, jre indicates that the environment variable is not correctly configured.