Eclipse
Eclipse is an open source community project, which aims to provide a universal development platform. The Eclipse project is most widely known for its cross-platform integrated development environment (IDE). The Arch Linux packages (and this guide) relate specifically to the IDE.
The Eclipse IDE is largely written in Java but can be used to develop applications in a number of languages, including Java, C/C++, PHP, Perl and Python. The IDE can also provide subversion support and task management.
Contents
- 1 Installation
- 2 Plugins
- 3 Enable javadoc integration
-
4 Troubleshooting
- 4.1 Crash on first boot or when choosing Help > Welcome
- 4.2 Ctrl+X closes Eclipse
- 4.3 Eclipse 4 not respecting dark/custom gtk themes resulting in white background
- 4.4 Tooltips have dark background color with Gnome 3.6 Adwaita theme
- 4.5 Toggle buttons states are the same for selected/not selected
- 4.6 Change Default Window Title Font Size
- 5 See also
Installation
Install the eclipse-java package from the official repositories. This base package has Java development support built in. Alternatively, eclipse-cpp is meant for C++ development. For some reason, these two packages are in conflict, and you will have to decide the one you want to use (see FS#45577).
Plugins
Many plugins are easily installed using pacman (see Eclipse plugin package guidelines for further informations). This will also keep them up-to-date. Alternatively, you can choose either the Eclipse Marketplace or the internal plugin manager.
Add the default update site
Make sure that you check that the default update site for your version of Eclipse is configured so that plugin dependencies can automatically be installed. The most current version of Eclipse is Mars and the default update site for it is: http://download.eclipse.org/releases/mars. Go to Help > Install new Software > Add, fill the name to easily identify the update site later - for instance, Mars Software Repository - and fill the location with the url.
Eclipse Marketplace
To use the Eclipse Marketplace, install it first: go to Help > Install new software > Switch to the default update site > General Purpose Tools > Marketplace Client. Restart Eclipse and it will be available in Help > Eclipse Marketplace.
Plugin manager
Use Eclipse's plugin manager to download and install plugins from their original repositories: in this case you have to find the needed repository in the plugin's website, then go to Help > Install New Software..., enter the repository in the Work with field, select the plugin to install from the list below and follow the instructions.
Updates via plugin manager
Run Eclipse and select Help > Check for Updates. If you have installed them as root as advised in the section above, you have to run Eclipse as root.
For plugins to be updated, you should check to have their update repositories enabled in Window > Preferences > Install/Update > Available Software Sites: you can find each plugin's repository(es) on the respective project website. To add, edit, remove... repositories just use the buttons on the right of the Available Software Sites panel. For Eclipse 4.5 (Mars), check you have enabled this repository:
http://download.eclipse.org/releases/mars
To receive update notifications, go to Window > Preferences > Install/Update > Automatic Updates. If you want to receive notifications for plugins installed as root, you should run Eclipse as root, go to Window > Preferences > Install/Update > Available Software Sites, select the repositories related to the installed plugins and Export them, then run Eclipse as normal user and Import them in the same panel.
List of plugins
- AVR — AVR microcontroller plugin.
- Aptana — HTML5/CSS3/JavaScript/Ruby/Rails/PHP/Pydev/Django support. Also available as standalone application.
- Eclipse CDT — C/C++ support.
- Eclipse PDT — PHP support.
- EclipseFP — Haskell support.
- EGit — Git support.
- EPIC — Perl support.
- IvyDE — IvyDE dependency Manager.
- Markdown — Markdown editor plugin for Eclipse.
- MercurialEclipse — Mercurial support.
- Mylyn — Task lists support.
- PHPEclipse — Alternative PHP support.
- PyDev — Python support.
- Subclipse — Subversion support.
- Subversive — Alternative Subversion support.
- TestNG — TestNG support.
- TeXlipse — LaTeX support.
- Eclipse PTP — Parallel Programming C/C++ support.
Enable javadoc integration
Want to see API entries when hovering the mouse pointer over standard Java methods?
Online version
If you have constant Internet access on your machine, you can use the on-line documentation:
- Go to Window > Preferences, then go to Java > Installed JREs.
- There should be one named "java" with the type "Standard VM". Select this and click Edit.
- Select the
/opt/java/jre/lib/rt.jar
item under "JRE system libraries:", then click Javadoc Location.... - Enter "https://docs.oracle.com/javase/8/docs/api/" in the "Javadoc location path:" text field.
Offline version
You can store the documentation locally by installing the openjdk8-doc package. Eclipse may be able to find the javadocs automatically. If that does not work, set Javadoc location for rt.jar to file:/usr/share/doc/java8-openjdk/api
.
Troubleshooting
Crash on first boot or when choosing Help > Welcome
Add the following line to /usr/share/eclipse/eclipse.ini
:
-Dorg.eclipse.swt.browser.UseWebKitGTK=true
If Firefox is installed try also:
-Dorg.eclipse.swt.browser.DefaultType=mozilla
Ctrl+X closes Eclipse
Part of this bug. Just look in ~/workspace/.metadata/.plugins/org.eclipse.e4.workbench/workbench.xmi
and delete the wrong Ctrl+X
combination. Usually it is the first one.
Eclipse 4 not respecting dark/custom gtk themes resulting in white background
4.2.0 and 4.3.0
Remove or move to backup sub folder all of the .css files from: /usr/share/eclipse/plugins/org.eclipse.platform_4.2.0.v201206081400/css/
Solution source: https://www.eclipse.org/forums/index.php/m/872214/
This also works with version 4.3.x (Kepler) by backing up the css folder from /usr/share/eclipse/plugins/org.eclipse.platform_4.3.xxx/css/
4.4.0 (Luna)
Luna Supplies a Dark theme which can be enabled in Preferences > Appearance and selecting the 'Dark' theme.
The dark theme uses its own colours rather than the GTK theme colours, if you prefer it to fully respect GTK colour settings, then remove or move to backup sub folder all of the .css files from: /usr/share/eclipse/plugins/org.eclipse.ui.themes_1.0.0.xxxx/css/
Tooltips have dark background color with Gnome 3.6 Adwaita theme
Comment out the second-to-last line in /usr/share/themes/Adwaita/gtk-2.0/gtkrc
like this
#widget "gtk-tooltip*" style "tooltips"
Related bugs:
- https://bugzilla.gnome.org/show_bug.cgi?id=688285
- https://bugs.eclipse.org/bugs/show_bug.cgi?id=381010 (WONTFIX)
Toggle buttons states are the same for selected/not selected
Comment out the last line in /usr/share/themes/Adwaita/gtk-2.0/gtkrc
like this
#widget "*swt*toolbar*" style "null"
To apply the fixed theme, use gnome-tweak-tool
to select a different theme and cycle back to Adwaita.
Related bugs:
Change Default Window Title Font Size
You cannot change the window title font size using the Eclipse preferences, you must edit the actual theme .css files. Note, that you will have to redo this when you upgrade eclipse. They are located under
/usr/share/eclipse/plugins/org.eclipse.platform_4.3.<your version number>/css
Open the appropriate file with your text editor, ie e4_default_gtk.css if you are using the "GTK theme". Search for .MPartStack, and change the font-size to your desired size
.MPartStack { font-size: 9; swt-simple: false; swt-mru-visible: false; }