This is an old revision of the document!


Eclipse

Eclipse is an Open Source cross-platform software development environment including an integrated development environment (IDE) and an extensible plugin system.

Basic vocabulary and facts:

  • Eclipse itself is a platform.
    Nothing more, nothing less. You can write your own, common applications based on the Eclipse platform. E.g. RSSOwl is Eclipse based.
  • Most GUI features and functionality are provided by Plugins.
    This is also true for Eclipse's main purpose: software development. E.g. the C/C++ editor comes with the “C/C++ Development Tools (CDT)” plugin, the Python support with the PyDev plugin and so on. Sometimes, there are even more than one plugins available, doing basically the same in different ways. Therefore, there is no “default” Eclipse. And a “naked” Eclipse may be nearly useless for many developers (this is comparable with a naked Microsoft Windows without any additional software).
  • Workspaces are keeping all your meta-data, settings and projects. And you can have an unlimited number of them.
    The first thing you have to do after Eclipse was started is to choose your Workspace. You can compare this with an user/account on operating systems: you can switch between different user accounts and you may have different fonts, links, backgrounds and data. This is very useful cause many companies and projects have different coding standards. E.g. you may create a Workspace for the ones working “2 spaces source code indentation” and “1 tab source code indentation”.
    There is only one downside of this approach: You can't share settings between different Workspaces. But a Workspace is just a directory, containing subdirectories and files so you can rename and copy them as you like. Therefore there is no problem to create a basic blueprint/template Workspace. Set your general configuration there and copy+rename it if you have to create a new Workspace.
  • Projects are logical “packages” in your Workspace
    FIXME Explain FIXME Explain that source code don't has to be stored with the Workspace/project. You can make existing directories usable with “New→Folder→Advanced→Link to alternate location”.
  • A “Working Set” is an optional categorization functionality
    Working Sets are something like “containers” to make large workspaces with many projects useable. Working Sets are able to group projects or even other Working Sets.

Installation

If you are using Dropbox or a comparable service, think about the following to make switching and/or re-installing workstations less painful:

  1. Put your workspaces into a synced directory.
  2. You may even install the whole application into a synced directory. So you don't have to install Eclipse on every machine and all of your Plugins are in sync.

Ubuntu

10.04 Lucid and above

Because Eclipse is written in Java, you need a functional Java Runtime Environment (JRE) before you can use it.

Installation, using the package manager

The Ubuntu repositories are showing a tendency to serve very old Eclipse versions.1) Ubuntu is no rolling release and this is also no problem regrading security, but the lack of new features and Plugins often hurts. Therefore you may consider the manual installation method which also provides some other benefits. Otherwise, simply install the following package(s):

  • eclipse (universe) – Provides the Eclipse platform, Java Development Tools (JDT) and the Plugin Development Environment (PDE)
Manual installation

A manual installation of Eclipse is not very problematic because it is a Java program, does not have much external dependencies and brings a built-in update mechanism. This makes Eclipse a very “portable” application. Therefore this is one of the rare cases where you won't loose any comfort and security by bypassing Ubuntu's package manager.

Main benefits of a manual installation:

  • You can use the newest available Eclipse version.
  • You can install Eclipse into a directory your user account got write access to (like ~/.eclipse):
    • This makes Plugin installations much easier.
    • You can use Eclipse even if you got no superuser privileges on the system (→ PC in your office or things like that).
    • You can move Eclipse around if you want to put it into another directory someday.
  • If you are using Dropbox or a comparable service, you may install the whole application into a synced directory. So you don't have to install Eclipse on every machine and all of your Plugins etc. are in sync.

To install Eclipse manually:

  1. Download the Eclipse version which fits best.
    The difference between all the offered packages are the Plugins which are installed by default.2) So don't worry: you can install additional Plugins later if you need a special functionality. E.g. if you are developing PHP and C++, there is no problem to start with “Eclipse for PHP Developers” and install the C++ Development Tools (CDT) Plugin after the basic Eclipse installation is done.
  2. Uncompress Eclipse:
    • If you are the only one using Eclipse on the target system, choose a directory you got write-access to3) (e.g. a directory within your home directory). You can move Eclipse later if you think the chosen directory does not fit your needs anymore. The following commands are using the dir /home/${USER}/.eclipse, simply replace it if you want to install Eclipse somewhere else:
      mkdir -p "/home/${USER}/.eclipse"
      tar xvfz ./eclipse-<version>-linux-gtk-<version>.tar.gz -C "/home/${USER}/.eclipse"
    • If you want to share the installation with other users on your PC, you probably want to uncompress Eclipse into /opt (superuser privileges needed):
      sudo tar xvfz ./eclipse-<version>-linux-gtk-<version>.tar.gz -C /opt
  3. Open a terminal to create a launcher script:
    • Open editor:
      gksudo gedit /usr/local/bin/eclipse
    • Put the following content into the file:
      #!/bin/bash
      #Eclipse starter. See http://readm3.org/app/eclipse/ for details
      export ECLIPSE_HOME="/home/${USER}/.eclipse" #directory where Eclipse was installed into (without trailing slash)
      export GDK_NATIVE_WINDOWS=1 #workaround to prevent "not working buttons", see http://blog.andreas-haerter.com/2010/07/24/what-gdk-native-windows-1-does
      export MOZILLA_FIVE_HOME="/usr/lib/mozilla/"
      
      ${ECLIPSE_HOME}/eclipse "$@" -vmargs -Xms256M -Xmx512M -XX:PermSize=256M -XX:MaxPermSize=512M

      If you did not install Eclipse into /home/${USER}/.eclipse, replace the value of ECLIPSE_HOME with the directory you used.

    • Make the script executable:
      sudo chmod a+x /usr/local/bin/eclipse

Plugins

The following lists all documented plugins:

2015/03/13 17:08  
2010/08/16 15:21 Andreas Haerter
2010/10/19 18:28 Andreas Haerter
2010/10/19 18:39 Andreas Haerter
2010/10/19 19:21 Andreas Haerter
2010/10/19 18:50 Andreas Haerter
2010/10/12 00:42 Andreas Haerter
2010/09/06 16:22 Andreas Haerter

Tips and tricks

Hotkeys / Keyboard shortcuts

You can look at and change all shortcuts by opening “Window→Preferences→General→Keys”. Most important ones (IMHO):

  • Navigate
    • Ctrl+L: Go to Line
    • Ctrl+Q: Jump back to the last edited line.
    • Alt+: Jump back to the last edited line within the last edited method or function.
    • Alt+: Jump forward after Alt+ was used.
    • Ctrl+F: Find text
    • Ctrl+K: Find next occurrence. This works also for currently marked text, you don't have to search for something before.
    • Ctrl+Shift+K: Find previous occurrence. This works also for currently marked text, you don't have to search for something before.
    • Ctrl+Shift+P: Jump to corresponding opening/closing (curly) bracket
    • Ctrl+F6
      Ctrl+E: Switch between open files.
    • Ctrl+Shift+R: Search for files within the projects. You can use upper case letters to find camel case filenames: e.g. “TFIC” is able to find “ThisFeatureIsCool.txt”.
    • Ctrl+.: Jump to next error (need activated syntax validation/“report errors as you type”)
  • Edit
    • Ctrl+Y: Undo
    • Ctrl+Y: Redo
    • Ctrl+Shift+C
      Ctrl+Shift+7:: (Un)Comment currently selected line(s)
  • Other
    • Ctrl+Shift+L: Show Hotkey-Cheat-Sheet4)
    • Ctrl+=: Zoom in.
    • Ctrl+: Zoom out.

Put everything into a Dropbox

If you are using Dropbox or a comparable service, think about the following to make switching and/or re-installing workstations less painful:

  1. Put your workspaces into a synced directory.
  2. You may even install the whole application into a synced directory. So you don't have to install Eclipse on every machine and all of your Plugins are in sync.

Troubleshooting

Resource is out of sync with the file system

This error is uncritical. If you are editing/moving/deleting managed within a workspace outside of Eclipse it can't know about the changes. Eclipse simply refuses to open such files to prevent errors cause they are out of sync as the error tells you. To re-sync them, right-click on the parent folder and choose “Refresh”.

"out of memory" errors

The solution is simple: give the Java VM/Eclipse more RAM (default is 128MB). E.g. start Eclipse with the following parameters to give it between 256-512MB of memory:

-vmargs -Xms256M -Xmx512M -XX:PermSize=256M -XX:MaxPermSize=512M

You may add them to your application starter/link.

Eclipse is very slow

If you got a slow CPU, try to disable:

  • Syntax checker/code assistant: Window→Preferences→Dynamic Languages→Report problems as you type
  • Spell checker: Window→General→Editors→Text Editors→Spelling→Enable spell checking.

Eclipse does not ask for a workspace at startup

Simply re-enable “Window→General→Startup and Shutdown→Workspaces→Prompt for workspace on startup”.

1)
this is especially true for Ubuntu 9.04 Jaunty which served Eclipse 3.2, a two year old version!
2)
e.g. “Eclipse for PHP Developers” simply ships Eclipse + the PHP Development Tools (PDT) Plugin
3)
this makes Plugin installations much easier
4)
a ein hotkey for hotkeys… LOL
Print/export
QR Code
QR Code app:eclipse:start (generated for current page)
Languages
Translations of this page: