Difference between revisions of "Eclipse"

From ArchWiki
Jump to: navigation, search
(Plugins: reformatting and adding some information)
m (Updates)
(37 intermediate revisions by 20 users not shown)
Line 1: Line 1:
[[Category:Development (English)]]
+
[[Category:Development]]
{{i18n|Eclipse}}
+
[[it:Eclipse]]
 +
[[ru:Eclipse]]
 +
[[zh-CN:Eclipse]]
 
[http://eclipse.org 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.
 
[http://eclipse.org 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 and Perl. The IDE can also provide subversion support (see below) and task management (either through its built-in TODO list or through the eclipse-mylyn package).
+
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 (see below) and task management (either through its built-in TODO list or through the eclipse-mylyn package).
  
 
== Installation ==
 
== Installation ==
  
It is very easy to install the Eclipse SDK in Arch Linux:
+
It is very easy to install the Eclipse SDK in Arch Linux, just [[Pacman|install]] the {{Pkg|eclipse}} package from the [[official repositories]].
# pacman -S eclipse
+
  
This base package has Java development support built in.
+
This base package has [[Java]] development support built in.
  
 
== Plugins ==
 
== Plugins ==
 
There are two methods to install plugins for Eclipse:
 
There are two methods to install plugins for Eclipse:
 
*using [[pacman]] to install plugins packaged in Arch repositories (see [[Eclipse plugin package guidelines]] for further informations);
 
*using [[pacman]] to install plugins packaged in Arch repositories (see [[Eclipse plugin package guidelines]] for further informations);
*using 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.
+
*using 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. Make sure that you first add the default update site for your installed version of Eclipse so that plugin dependencies can automatically be installed. The most current version of Eclipse is Juno and the default update site for Juno is: http://download.eclipse.org/releases/juno
  
 
{{Warning|
 
{{Warning|
*If you install plugins with Eclipse's plugin manager, you are advised to launch Eclipse as root: this way the plugins will be installed in {{Filename|/usr/share/eclipse/plugins/}}; if you installed them as normal user, they would be stored in a version-dependent folder inside {{Filename|~/.eclipse/}}, and, after upgrading Eclipse, they wouldn't be recognized any longer.
+
*If you install plugins with Eclipse's plugin manager, you are advised to launch Eclipse as root: this way the plugins will be installed in {{ic|/usr/share/eclipse/plugins/}}; if you installed them as normal user, they would be stored in a version-dependent folder inside {{ic|~/.eclipse/}}, and, after upgrading Eclipse, they wouldn't be recognized any longer.
 
*Do not use Eclipse as root for your everyday work.}}
 
*Do not use Eclipse as root for your everyday work.}}
  
Line 25: Line 26:
 
==== Eclipse CDT ====
 
==== Eclipse CDT ====
 
*Project homepage: http://www.eclipse.org/cdt/
 
*Project homepage: http://www.eclipse.org/cdt/
*Package in [extra]: {{Package Official|eclipse-cdt}}
+
*Package in [extra]: {{Pkg|eclipse-cdt}}
  
 
=== Perl support ===
 
=== Perl support ===
Line 31: Line 32:
 
====EPIC====
 
====EPIC====
 
*Project homepage: http://www.epic-ide.org/
 
*Project homepage: http://www.epic-ide.org/
*Package in [[AUR]]: {{Package AUR|eclipse-epic}}
+
*Package in [[AUR]]: {{AUR|eclipse-epic}}
  
 
=== [[PHP]] support ===
 
=== [[PHP]] support ===
Line 37: Line 38:
 
==== Eclipse PDT ====
 
==== Eclipse PDT ====
 
*Project homepage: http://www.eclipse.org/pdt/
 
*Project homepage: http://www.eclipse.org/pdt/
*Package in [[AUR]]: {{Package AUR|eclipse-pdt}}
+
*Instructions for the Eclipse plugin version: http://wiki.eclipse.org/PDT/Installation
 +
*Package in [[AUR]]: {{AUR|eclipse-pdt}}
  
 
==== PHPEclipse ====
 
==== PHPEclipse ====
 
*Project homepage: http://www.phpeclipse.com/
 
*Project homepage: http://www.phpeclipse.com/
*Package in [community]: {{Package Official|eclipse-phpeclipse}}
+
*Package in [[AUR]]: {{AUR|eclipse-phpeclipse}}
  
 
==== Aptana PHP ====
 
==== Aptana PHP ====
 
See Aptana Studio further down.
 
See Aptana Studio further down.
  
=== Python ===
+
=== [[Python]] support ===
  
 
==== PyDev ====
 
==== PyDev ====
 
*Project homepage: http://pydev.org/
 
*Project homepage: http://pydev.org/
*Package in [[AUR]]: {{Package AUR|eclipse-pydev}}
+
*Package in [[AUR]]: {{AUR|eclipse-pydev}}
  
 
=== Web development (HTML, CSS, JavaScript...) ===
 
=== Web development (HTML, CSS, JavaScript...) ===
Line 57: Line 59:
 
*Project homepage: http://www.aptana.org/
 
*Project homepage: http://www.aptana.org/
 
*For the Eclipse plugin version, use Eclipse's plugin manager
 
*For the Eclipse plugin version, use Eclipse's plugin manager
*For the standalone version, there is a package in [[AUR]]: {{Package AUR|aptana-studio}}
+
*For the standalone version, there is a package in [[AUR]]: {{AUR|aptana-studio}}
  
 
=== [[Subversion]] support ===
 
=== [[Subversion]] support ===
Line 63: Line 65:
 
==== Subclipse ====
 
==== Subclipse ====
 
*Project homepage: http://subclipse.tigris.org/
 
*Project homepage: http://subclipse.tigris.org/
*Package in [community]: {{Package Official|eclipse-subclipse}}
+
*Package in [[AUR]]: {{AUR|eclipse-subclipse}}
 
*[http://www-128.ibm.com/developerworks/opensource/library/os-ecl-subversion/ How to use Subversion with Eclipse]
 
*[http://www-128.ibm.com/developerworks/opensource/library/os-ecl-subversion/ How to use Subversion with Eclipse]
  
 
==== Eclipse Subversive ====
 
==== Eclipse Subversive ====
 
*Project homepage: http://www.eclipse.org/subversive/
 
*Project homepage: http://www.eclipse.org/subversive/
*Package in [[AUR]]: {{Package AUR|eclipse-subversive}}
+
*Package in [[AUR]]: {{AUR|eclipse-subversive}}
  
 
=== [[Git]] support ===
 
=== [[Git]] support ===
*Project homepage: http://www.eclipse.org/egit/
+
 
*Package in [[AUR]]: {{Package AUR|egit}}
+
==== EGit ====
 +
*Project homepage: http://www.eclipse.org/egit
 +
*Eclipse Update Link: http://download.eclipse.org/egit/updates
 +
*Package in [[AUR]]: {{AUR|eclipse-egit}}
 +
 
 +
=== [[Mercurial]] support ===
 +
 
 +
==== MercurialEclipse ====
 +
*Project homepage: http://code.google.com/a/eclipselabs.org/p/mercurialeclipse/
 +
*Eclipse Update Link: http://mercurialeclipse.eclipselabs.org.codespot.com/hg.wiki/update_site/stable
 +
*Package in [[AUR]]: {{AUR|eclipse-mercurial}}
 +
 
 +
===[[LaTeX]] support ===
 +
 
 +
==== TeXlipse ====
 +
*Project homepage: http://texlipse.sourceforge.net/
 +
*Eclipse Update Link: http://texlipse.sourceforge.net
  
 
==Updates==
 
==Updates==
Line 78: Line 96:
 
*For plugins installed with Eclipse's 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 installed with Eclipse's 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 3.7 (Indigo), check you have enabled this repository:
+
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.2 (Juno), check you have enabled this repository:
  
  http://download.eclipse.org/releases/indigo
+
  http://download.eclipse.org/releases/juno
  
 
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.
 
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.
 
== Using Sun JDK in place of OpenJDK ==
 
{{Accuracy}}
 
Eclipse depends on openjdk6 by default, which you can easily replace with jdk, following [[Java|this article]].
 
 
By the way, you may want to link the file /opt/java/bin/java to /usr/bin/java:
 
# ln -s /opt/java/bin/java /usr/bin
 
  
 
== Enable javadoc integration ==
 
== Enable javadoc integration ==
Line 100: Line 111:
 
# Go to Window/Preferences, then go to Java/Installed JREs.
 
# 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.
 
# There should be one named "java" with the type "Standard VM". Select this and click Edit.
# Select the {{Filename|/opt/java/jre/lib/rt.jar}} item under "JRE system libraries:", then click "Javadoc Location...".
+
# Select the {{ic|/opt/java/jre/lib/rt.jar}} item under "JRE system libraries:", then click "Javadoc Location...".
 
# Enter "http://java.sun.com/javase/6/docs/api/" in the "Javadoc location path:" text field.
 
# Enter "http://java.sun.com/javase/6/docs/api/" in the "Javadoc location path:" text field.
 
# Done!
 
# Done!
Line 106: Line 117:
 
=== Offline Version ===
 
=== Offline Version ===
  
If you have no internet connection on your development machine or do not want to constantly consume bandwidth for the documentation, you can store the documentation locally.
+
If you have no internet connection on your development machine or do not want to constantly consume bandwidth for the documentation, you can store the documentation locally, by installing the {{ic|openjdk[version]-src}} package. Eclipse should find the javadocs automatically.
 
+
# Start your favorite web browser and navigate to http://java.sun.com/javase/downloads/index.jsp
+
# Search for "Java SE 6 Documentation" and click the Download link.
+
# Follow the instructions to download the "jdk-6-doc.zip" file. (e.g. to {{Filename|/home/docs/jdk-6-doc.zip}}).
+
# 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 {{Filename|/opt/java/jre/lib/rt.jar}} item under "JRE system libraries:", then click "Javadoc Location...".
+
# Select the point "Javadoc in archive"
+
# Enter the path to the previously downloaded {{Filename|jdk-6-doc.zip}} (e.g. {{Filename|/home/docs/jdk-6-doc.zip}}) in the "Archive path:" text field.
+
# Done!
+
  
 
== Troubleshooting ==
 
== Troubleshooting ==
  
 
=== Autocompletion and javadoc render crash ===
 
=== Autocompletion and javadoc render crash ===
For some reason, libxul may crash. To fix this issue, you can try installing {{Package Official|libwebkit}} and adding the following lines in your {{Filename|/usr/share/eclipse/eclipse.ini}}:  
+
For some reason, libxul may crash Eclipse with a Traceback like
 +
 
 +
# Problematic frame:
 +
# C  [libxul.so+0xd07552]  NS_InvokeByIndex_P+0x5e9a
 +
 
 +
To fix this issue, you can try installing {{Pkg|libwebkit}} and adding the following lines in your {{ic|/usr/share/eclipse/eclipse.ini}}:  
  
 
  -Dorg.eclipse.swt.browser.UseWebKitGTK=true
 
  -Dorg.eclipse.swt.browser.UseWebKitGTK=true
  
If that does not work (or if you do not want to use libwebkit) try:
+
If that does not work (or if you do not want to use libwebkit) try this:
 +
 
 +
:1. Download http://ftp.mozilla.org/pub/mozilla.org/xulrunner/releases/1.9.0.17/runtimes/xulrunner-1.9.0.17.en-US.linux-i686.tar.bz2
 +
:2. Unpack it into {{ic|/home/<Username>/.xulrunner}} (or another location)
 +
:3. Add this line to your Eclipse configuration file {{ic|/usr/share/eclipse/eclipse.ini}}:
 +
 
 +
-Dorg.eclipse.swt.browser.XULRunnerPath=/home/<Username>/.xulrunner
 +
 
 +
:Now everything should just work fine and tooltips should display correctly.
 +
 
 +
=== Crash on first boot or when choosing "Help -> Welcome" ===
 +
See above.
 +
 
 +
=== Ctrl+X closes Eclipse ===
 +
Part of [https://bugs.eclipse.org/bugs/show_bug.cgi?id=318177 this] bug. Just look in {{ic|~/workspace/.metadata/.plugins/org.eclipse.e4.workbench/workbench.xmi}} and delete the wrong {{Keypress|Ctrl+X}} combination. Usually it is the first one.
 +
 
 +
=== Eclipse 4.2.0 not respecting dark/custom gtk themes resulting in white background ===
 +
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: http://www.eclipse.org/forums/index.php/m/872214/
 +
 
 +
=== Tooltips have dark background color with Gnome 3.6 Adwaita theme ===
 +
 
 +
Comment out the second-to-last line in {{ic|/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 {{ic|/usr/share/themes/Adwaita/gtk-2.0/gtkrc}} like this
 +
 
 +
#widget "*swt*toolbar*" style "null"
  
-Dorg.eclipse.swt.browser.XULRunnerPath=/usr/bin
+
To apply the fixed theme, use {{ic|gnome-tweak-tool}} to select a different theme and cycle back to Adwaita.
  
=== Crash on first boot or when choosing "Help->Welcome" ===
+
Related bugs:  
Same as above. Edit {{filename|/usr/share/eclipse/eclipse.ini}} and add just below -vmargs the line:
+
  
-Dorg.eclipse.swt.browser.XULRunnerPath=/usr/bin
+
* https://bugzilla.gnome.org/show_bug.cgi?id=687519

Revision as of 16:30, 27 January 2013

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 (see below) and task management (either through its built-in TODO list or through the eclipse-mylyn package).

Installation

It is very easy to install the Eclipse SDK in Arch Linux, just install the eclipse package from the official repositories.

This base package has Java development support built in.

Plugins

There are two methods to install plugins for Eclipse:

  • using pacman to install plugins packaged in Arch repositories (see Eclipse plugin package guidelines for further informations);
  • using 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. Make sure that you first add the default update site for your installed version of Eclipse so that plugin dependencies can automatically be installed. The most current version of Eclipse is Juno and the default update site for Juno is: http://download.eclipse.org/releases/juno
Warning:
  • If you install plugins with Eclipse's plugin manager, you are advised to launch Eclipse as root: this way the plugins will be installed in /usr/share/eclipse/plugins/; if you installed them as normal user, they would be stored in a version-dependent folder inside ~/.eclipse/, and, after upgrading Eclipse, they wouldn't be recognized any longer.
  • Do not use Eclipse as root for your everyday work.

C/C++ support

Eclipse CDT

Perl support

EPIC

PHP support

Eclipse PDT

PHPEclipse

Aptana PHP

See Aptana Studio further down.

Python support

PyDev

Web development (HTML, CSS, JavaScript...)

Aptana Studio

Subversion support

Subclipse

Eclipse Subversive

Git support

EGit

Mercurial support

MercurialEclipse

LaTeX support

TeXlipse

Updates

  • Eclipse and the plugins installed with pacman are obviously updated with pacman itself.
  • For plugins installed with Eclipse's 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.2 (Juno), check you have enabled this repository:

http://download.eclipse.org/releases/juno

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.

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 provided by sun. Just follow these instructions:

  1. Go to Window/Preferences, then go to Java/Installed JREs.
  2. There should be one named "java" with the type "Standard VM". Select this and click Edit.
  3. Select the /opt/java/jre/lib/rt.jar item under "JRE system libraries:", then click "Javadoc Location...".
  4. Enter "http://java.sun.com/javase/6/docs/api/" in the "Javadoc location path:" text field.
  5. Done!

Offline Version

If you have no internet connection on your development machine or do not want to constantly consume bandwidth for the documentation, you can store the documentation locally, by installing the openjdk[version]-src package. Eclipse should find the javadocs automatically.

Troubleshooting

Autocompletion and javadoc render crash

For some reason, libxul may crash Eclipse with a Traceback like

# Problematic frame:
# C  [libxul.so+0xd07552]  NS_InvokeByIndex_P+0x5e9a

To fix this issue, you can try installing libwebkit and adding the following lines in your /usr/share/eclipse/eclipse.ini:

-Dorg.eclipse.swt.browser.UseWebKitGTK=true

If that does not work (or if you do not want to use libwebkit) try this:

1. Download http://ftp.mozilla.org/pub/mozilla.org/xulrunner/releases/1.9.0.17/runtimes/xulrunner-1.9.0.17.en-US.linux-i686.tar.bz2
2. Unpack it into /home/<Username>/.xulrunner (or another location)
3. Add this line to your Eclipse configuration file /usr/share/eclipse/eclipse.ini:
-Dorg.eclipse.swt.browser.XULRunnerPath=/home/<Username>/.xulrunner
Now everything should just work fine and tooltips should display correctly.

Crash on first boot or when choosing "Help -> Welcome"

See above.

Ctrl+X closes Eclipse

Part of this bug. Just look in ~/workspace/.metadata/.plugins/org.eclipse.e4.workbench/workbench.xmi and delete the wrong Template:Keypress combination. Usually it is the first one.

Eclipse 4.2.0 not respecting dark/custom gtk themes resulting in white background

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: http://www.eclipse.org/forums/index.php/m/872214/

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:

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: