Install Java 8 and Eclipse on Ubuntu 16.04


  • Description: A note on the Java setup on Ubuntu 16.04
  • My Notion Note ID: K2A-C2-1
  • Created: 2018-01-02
  • Updated: 2026-02-28
  • License: Reuse is very welcome. Please credit Yu Zhang and link back to the original on yuzhang.io

1. Install Java 8 on Ubuntu

On terminal, type the following command:

sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer
sudo apt-get install oracle-java8-set-default

Type the following to check the Java version:

java -version

2. Install Eclipse IDE for Java Developers

Download Eclipse from https://www.eclipse.org/downloads/eclipse-packages/.

In the terminal, type:

sudo tar -xvzf ~/Downloads/eclipse* --directory /opt/

And:

sudo vim /usr/share/applications/eclipse.desktop

In the eclipse.desktop file, type the following content:

[Desktop Entry]
Name=Eclipse
Type=Application
Exec=/opt/eclipse/eclipse
Terminal=false
Icon=/opt/eclipse/icon.xpm
Comment=Integrated Development Environment
NoDisplay=false
Categories=Development;IDE;
Name[en]=Eclipse