How to Install Eclipse IDE on Ubuntu 20.04

 

install eclipse on ubuntu 20.04 lts

Eclipse is one of the most popular open-source IDE (Integrated Development Environment) for software developers. It is popular for Java-based applications, also used for C/C++, PHP, and Perl and other web projects.

Eclipse is a really powerful IDE that supports many programming languages. It provides numerous plugins and extensions for enhancing the functionality of your Eclipse such as source code version control (git, svn), class diagram generator, GUI builder.

This tutorial will show you 2 methods to install Eclipse on Ubuntu 20.04 LTS machine.

Prerequisites

In order to install Eclipse IDE, you have to install JRE (Java Runtime Environment) on your Ubuntu machine:

$ sudo apt update
$ sudo apt install openjdk-14-jre

To verify that Java was successfully installed, let's run:

$ java --version

Output:

openjdk 14.0.1 2020-04-14
OpenJDK Runtime Environment (build 14.0.1+7-Ubuntu-1ubuntu1)
OpenJDK 64-Bit Server VM (build 14.0.1+7-Ubuntu-1ubuntu1, mixed mode, sharing)

Install Eclipse by installer package [Method 1]

At the time of this writing, the latest version of Eclipse is: Eclipse IDE 2020-06. Eclipse can be downloaded via the browser on its official website https://www.eclipse.org/downloads/

By default, the installer package is downloaded into the directory '~/Downloads' with name: 'eclipse-inst-linux64.tar.gz'.

Or by using the wget command as:

$ wget https://download.eclipse.org/oomph/epp/2020-06/R/eclipse-inst-linux64.tar.gz

Let's extract the downloaded tarball file to the directory '/opt' by running the following command:

$ sudo tar -xf eclipse-inst-linux64.tar.gz -C /opt

Eclipse installer: eclipse-inst

In order to install Eclipse, launch the installer file 'eclipse-inst' by running the following command:

$ cd /opt/eclipse-installer
$ sudo ./eclipse-inst

Eclipse packages window appears, let's choose your favorite package IDE.

Eclipse installer window

For example, select the Eclipse IDE for C/C++ Developers then click INSTALL

Eclipse IDE for C/C++ Developers

Next, you have to accept the Eclipse Foundation Software User Agreement.

Eclipse Software User Agreement

Now, your Eclipse IDE will be installing.

Installing Eclipse

After the installation has completed, Eclipse is ready to be launched.

Eclipse installation by snap [ Method 2]

Installing Eclipse by snap package manager is the handiest installation method to bring the Eclipse integrated development environment to your Ubuntu machine.

$ sudo snap install --classic eclipse

In order to install an old version of Eclipse, you can use the apt package manager:

$ sudo apt install eclipse

Another simple way to install Eclipse IDE is using Ubuntu Software Center. Let's open the software center and search for Eclipse then click the Install button.

Create launcher icon

Once the Eclipse is downloaded and installed successfully, you may need to create a shortcut to launch your IDE. Using your favorite editor to create a file named 'eclipse.desktop' and enter the following lines to it:

[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
Name[en_US]=Eclipse

Please note that the paths in lines 'Exec=' and 'Icon=' are depended on your system. You can find the path in Exec line by running command:

$ which eclipse

Now, let's enable the launcher icon:

$ sudo chmod +x eclipse.desktop
$ sudo mv eclipse.desktop /usr/share/applications/eclipse.desktop

That's all. From now on, you can search for eclipse and launch it in the Applications center on your Ubuntu machine.

Conclusion

In this tutorial, we learned how to install the Eclipse IDE on Ubuntu 20.04. You can now begin to write your own codes to create many awesome applications with Eclipse.

Thanks for reading and please leave your suggestion in the below comment section.

Bobbin Zachariah 12:20 pm

Comments

Your email address will not be published. Required fields are marked *

4 Comments

  1. Installed in /root/eclipse/parallel-2020-06/eclipse/eclipse
    eclipse.desktop installed in /usr/share/applications/eclipse.desktop
    But Eclipse is not found by the system (Ubuntu 20.04).
    Great very clear instructions. I must be close.
    Thanks for any help
    Carl

  2. Hello, some suggestions.
    * You can also add locale to comment field, which is more useful then the name.
    * From the installation directory, run ./eclipse -initialize to make it start faster.
    * Check the desktop file with `desktop-file-verify eclipse.desktop' before installation. It is easy to be some errors if not.
    * One could also install with `desktop-file-install eclipse.desktop' if one doesn't want to look up where they should be stored.
    * I usually add a short script in /usr/local/bin that launches the right version from /opt/Eclipse/eclipse-*/eclipse. So I rename the /opt/Eclipse/eclipse to the version number so I do remember which I have installed. I usually also make a symbolic link `ln -s eclipse eclipse-2020-12' so I also reach it as the current one. Then it is easy to have old and new installed at the same time.

    The script in /usr/local/bin/eclipse-base looks like this.
    #!/bin/sh
    #
    # Make a link to this script, and it will try
    # to start an eclipse in the same directory
    #
    # If it doesn't exists, it just will fail.

    exec /opt/Eclipse/`basename $0`/eclipse $*

    Then I only make a soft or hard link from the version number to this base, like this:
    $ ls -l eclipse*
    lrwxrwxrwx 1 root root 12 sep 23 13:39 eclipse -> eclipse-base
    lrwxrwxrwx 1 root root 12 sep 23 12:43 eclipse-2019-09 -> eclipse-base
    lrwxrwxrwx 1 root root 12 sep 23 12:42 eclipse-2019-12 -> eclipse-base
    lrwxrwxrwx 1 root root 12 sep 23 12:44 eclipse-2020-09 -> eclipse-base
    -rwxrwxr-x 1 root root 191 sep 23 12:41 eclipse-base
    $

    Now I can easily start eclipse from command line, and based on the name, it choose right binary in /opt/Eclipes/*/eclipse to run.