IntroductionEclipse is a powerful and feature-rich IDE for Java developers, but the versions packaged with Debian and Ubuntu lag far behind the latest releases. In fact, the version shipping with Ubuntu 16.04 was released in 2012 and was discontinued quite some time ago.
Despite the fact that both Ubuntu and Debian don't package and ship new versions of it anymore, Eclipse is still easily available to users of both distributions. You just have to go about getting it a different way, and the Eclipse developers have a great solution for this.
Getting Java 8Since Eclipse is primarily a Java IDE(You can use it with other languages), you're probably going to want to install Java 8 on your system to be able to develop applications. The good news is; Java 8 is available for both Ubuntu and Debian.
Debian JessieJava 8 was not made available to Debian users when Jessie was first launched, but it is available through the
jessie-backportsrepository. So, the first step in getting Java 8 installed is to enable that repository.
/etc/apt/sources.listin your favorite text editor as
rootand add the following line.
# Backports repository deb http://httpredir.debian.org/debian jessie-backports mainFeel free to add
non-freeif you'd like too.
aptwith the new repository.
# apt-get updateAfter
aptfinishes updating, you can install the packages from
# apt-get -t jessie-backports install openjdk-8-jre openjdk-8-jdk
Ubuntu 16.04For users of Ubuntu 16.04, getting Java 8 installed is very easy. It's available right in the default Ubuntu repositories. Just use
aptto install the packages.
$ sudo apt-get install openjdk-8-jre openjdk-8-jdk
Downloading EclipseThe Eclipse developers provide two ways to install Eclipse. One of them involves downloading and using a custom installer program that can select different versions of Eclipse and IDEs for different languages, like C++ and PHP. Since this guide is focused on Java, it is going to cover the more direct route.
Eclipse is provided as a pre-compiled binary in a tarball. This is the simplest way to distribute it in a way that will work for every Linux distribution.
To get the tarball, navigate to the download page on the Eclipse website.
https://www.eclipse.org/downloads/download.php?file=/technology/epp/downloads/release/neon/1a/eclipse-java-neon-1a-linux-gtk-x86_64.tar.gzOnce there, click the "Download" button. You can either use your graphical archive manage and extract it to the directory of your choosing or save it and use
tar. This guide is going to use
cdinto the directory where you want Eclipse "installed." Eclipse is more-or-less self-contained in its folder, so it's not really installed on the system. It's just a binary that resides in your
Once there, use
tarto extract the archive into that directory.
$ cd ~ $ tar xpf Downloads/eclipse-java-neon-1a-linux-gtk-x86_64.tar.gzThe resulting folder will simply be called "eclipse."
Running EclipseNow, a functional installation of Eclipse exists on your system at
~/eclipse. You can either launch it graphically from your file browser by clicking on the item in the folder called, "eclipse," or you can launch it from the command line.
$ cd eclipse $ ./eclipseWhen you run it, Eclipse will prompt you to set up a workspace for yourself. This is the folder that will contain all of your projects and their associated files.
Creating A Launch IconIt may be better than nothing, but launching Eclipse this way is far from ideal. Since this is Linux, the solution is quite simple; create a
.desktopfile for it.
To create the desktop file,
.local/share/applicationsin your home directory.
$ cd ~/.local/share/applicationsCreate a new file using your favorite text editor called
eclipse.desktop. You can customize the file how you like, but if you're not sure what to add, copy the example below.
[Desktop Entry] Type=Application Name=Eclipse Icon=/home/YOURUSER/eclipse/icon.xpm Path=/home/YOURUSER/eclipse Exec=/home/YOURUSER/eclipse/eclipse StartupNotify=false StartupWMClass=EclipseNow, Eclipse should be available through your desktop environment's menu. If it's not there, logout and log back in. It's also important to use absolute paths like the ones specified. Relative paths or variables like
ConclusionUsing this method, you can install and use the latest versions of Eclipse with up-to-date versions of Java on Debian and Ubuntu. To keep your Eclipse install current, use the built-in update functionality in the program by navigating to
Help > Check for Updates.