Difference between revisions of "Eclipse"

From ArchWiki
Jump to: navigation, search
m (still improving)
(spanish interlanguage link)
 
(135 intermediate revisions by 63 users not shown)
Line 1: Line 1:
[[Category:Development (English)]]
+
[[Category:Integrated development environments]]
{{i18n|Eclipse}}
+
[[es: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.
+
[[it:Eclipse]]
 +
[[ja:Eclipse]]
 +
[[ru:Eclipse]]
 +
[[zh-hans:Eclipse]]
 +
[https://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 and task management.
  
 
== Installation ==
 
== Installation ==
  
It is very easy to install the Eclipse SDK in Arch Linux:
+
[[Install]] one of the following packages:
# pacman -S eclipse
 
  
This base package has Java development support built in.
+
* {{Pkg|eclipse-jee}} for Java EE Developers
 +
* {{Pkg|eclipse-java}} for Java Developers
 +
* {{Pkg|eclipse-cpp}} for C/C++ Developers
 +
* {{Pkg|eclipse-php}} for PHP Developers
 +
* {{Pkg|eclipse-javascript}} for JavaScript and Web Developers
 +
 
 +
You cannot install multiple of these at the same time since they conflict, see {{Bug|45577}}: choose the package above which most immediately fulfills your needs, and then add support for any additionally required languages through [[#Plugins]].
  
 
== Plugins ==
 
== 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 go to ''Help -> Install New Software...'', enter the plugin repository in the ''Work with'' field, select the plugin to install from the list below and follow the instructions.
 
  
{{Warning|
+
Many plugins are easily installed using '''pacman''' (see [[Eclipse plugin package guidelines]] for further information). This will also keep them up-to-date. Alternatively, you can choose either the [[#Eclipse Marketplace|Eclipse Marketplace]] or the internal [[#Plugin manager|plugin manager]].
*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, when upgrading Eclipse, you would apparently lose them all.
+
 
*Do not use Eclipse as root for your everyday work.}}
+
=== 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 Photon and the default update site for it is: http://download.eclipse.org/releases/photon. Go to Help > Install new Software > Add, fill the name to easily identify the update site later - for instance, Photon Software Repository - and fill the location with the url.
 +
 
 +
=== Eclipse Marketplace ===
 +
 
 +
{{Note|make sure you have followed the [[#Add the default update site|Add the default update site]] section.}}
 +
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.
  
=== C/C++ support ===
+
=== Plugin manager ===
  
If you want to use Eclipse for C/C++ development, also install the Eclipse CDT:
+
{{Note|make sure you have followed the [[#Add the default update site|Add the default update site]] section.}}
# pacman -S eclipse-cdt
+
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.
  
=== Perl support ===
+
{{Note|
 +
* 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/lib/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 would not be recognized any longer.
 +
* Do not use Eclipse as root for your everyday work.
 +
}}
  
If you want to use Eclipse for Perl development, also install EPIC:
+
==== Updates via plugin manager ====
# pacman -S eclipse-epic
 
  
=== PHP support ===
+
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.
  
If you want to use Eclipse for PHP development, also install phpeclipse:
+
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:
# pacman -S eclipse-phpeclipse
 
  
=== Subversion support ===
+
http://download.eclipse.org/releases/mars
There are packages in [community] and [[AUR]] for enabling [[Subversion]] support.
 
  
====eclipse-subclipse====
+
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.
From the [http://subclipse.tigris.org/ project home], "Subclipse is an Eclipse Team Provider plug-in providing support for Subversion within the Eclipse IDE."
 
# pacman -S eclipse-subclipse
 
  
Take a look at [http://www-128.ibm.com/developerworks/opensource/library/os-ecl-subversion/ How to use Subversion with Eclipse] for more information about Subclipse.
+
=== List of plugins ===
  
====eclipse-subversive====
+
* {{App|AVR|AVR microcontroller plugin.|http://avr-eclipse.sourceforge.net/wiki/index.php/The_AVR_Eclipse_Plugin|{{AUR|eclipse-avr}}}}
{{Package AUR|eclipse-subversive}} is available from [[AUR]].
+
* {{App|Aptana|HTML5/CSS3/JavaScript/Ruby/Rails/PHP/Pydev/Django support. Also available as standalone application.|http://www.aptana.com/|{{AUR|aptana-studio}}}}
 +
* {{App|IvyDE|IvyDE dependency Manager.|https://ant.apache.org/ivy/ivyde/|{{AUR|eclipse-ivyde}}}}
 +
* {{App|Markdown|Markdown editor plugin for Eclipse.|http://www.winterwell.com/software/markdown-editor.php|{{AUR|eclipse-markdown}}}}
 +
* {{App|PyDev|[[Python]] support.|http://pydev.org/|{{AUR|eclipse-pydev}}}}
 +
* {{App|Subclipse|[[Subversion]] support.|https://github.com/subclipse/subclipse|{{AUR|eclipse-subclipse}}}}
 +
* {{App|Subversive|Alternative Subversion support.|https://www.eclipse.org/subversive/|{{AUR|eclipse-subversive}}}}
 +
* {{App|TestNG|TestNG support.|http://testng.org/doc/eclipse.html|{{AUR|eclipse-testng}}}}
 +
* {{App|TeXlipse|[[LaTeX]] support.|http://texlipse.sourceforge.net/|{{AUR|eclipse-texlipse}}}}
 +
* {{App|Checkstyle|Eclipse Checkstyle support.|http://eclipse-cs.sourceforge.net/|{{AUR|eclipse-checkstyle}}}}
  
See http://www.eclipse.org/subversive/ for details about this project.
+
== Enable javadoc integration ==
  
=== Git support ===
+
Want to see API entries when hovering the mouse pointer over standard Java methods?
{{Package AUR|egit}} is available from [[AUR]].
 
  
Alternatively, add this repository to the Available Software Sites:
+
=== Online version ===
  
http://download.eclipse.org/egit/updates
+
If you have constant Internet access on your machine, you can use the on-line documentation:
  
and install egit with Eclipse's plugin manager.
+
# 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 {{ic|/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.
  
See http://www.eclipse.org/egit/ for details about this project.
+
=== Offline version ===
  
==Updates==
+
You can store the documentation locally by installing the {{Pkg|openjdk8-doc}} package.  Eclipse may be able to find the javadocs automatically. If that does not work, set Javadoc location for rt.jar to {{ic|file:/usr/share/doc/java8-openjdk/api}}.
*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 3.7 (Indigo), check you have enabled this repository:
+
== Troubleshooting ==
  
http://download.eclipse.org/releases/indigo
+
=== Ctrl+X closes Eclipse ===
  
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.
+
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 {{ic|Ctrl+X}} combination. Usually it is the first one.
  
== Using Sun JDK in place of OpenJDK ==
+
=== Dark theme ===
{{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:
+
Eclipse supplies a Dark theme which can be enabled in Window > Preferences > General > Appearance and selecting the 'Dark' theme.
# ln -s /opt/java/bin/java /usr/bin
 
  
== Enable javadoc integration ==
+
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 {{ic|/usr/share/eclipse/plugins/org.eclipse.ui.themes_1.0.0.xxxx/css/}}.
Want to see API entries when hovering the mouse pointer over standard Java methods?
+
 
 +
=== 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;
 +
}
 +
 
 +
=== Disable GTK+ 3 ===
 +
 
 +
When the SWT GTK+ 3 UI is buggy and sometimes unusable, You can try to disable the use of GTK+ 3 with the SWT_GTK3=0 [[environment variable]] when you start eclipse:
 +
SWT_GTK3=0 eclipse
  
=== Online Version ===
+
Another option to achieve the same effect is to add the following to {{ic|/usr/lib/eclipse/eclipse.ini}}.
 +
--launcher.GTK_version
 +
2
  
If you have constant internet access on your machine, you can use the on-line documentation provided by sun. Just follow these instructions:
+
Those two lines must be added '''before''':
 +
--launcher.appendVmargs
  
# Go to Window/Preferences, then go to Java/Installed JREs.
+
=== Freshplayerplugin ===
# 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...".
 
# Enter "http://java.sun.com/javase/6/docs/api/" in the "Javadoc location path:" text field.
 
# Done!
 
  
=== Offline Version ===
+
Eclipse is not compatible with {{AUR|freshplayerplugin}}. See https://github.com/i-rinat/freshplayerplugin/issues/298.
  
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.
+
=== Eclipse 4.6 may not open the marketplace properly===
  
# Start your favorite web browser and navigate to http://java.sun.com/javase/downloads/index.jsp
+
See [https://bugs.eclipse.org/bugs/show_bug.cgi?id=497729 this] bug. You can take following two steps to fix it:
# 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 ==
+
eclipse -consoleLog -application org.eclipse.equinox.p2.director -uninstallIU org.apache.httpcomponents.httpclient/4.3.6.v201411290715
 +
cd /usr/lib/eclipse/ && sudo rm plugins/org.apache.httpcomponents.httpclient_4.3.6.v201411290715.jar
  
=== Autocompletion and javadoc render crash ===
+
=== Show in System Explorer does not work ===
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}}:
+
See [http://help.eclipse.org/luna/index.jsp?topic=%2Forg.eclipse.platform.doc.user%2Freference%2Fref-9.htm&cp=0_4_1_52 this] guide. Go to '''Window''' > '''Preferences''' > '''General''' > '''Workspace''' and change the command launching system explorer. As Xfce user you may like to change it to {{ic|thunar ${selected_resource_uri} }} to open the selected folder with thunar.
  
-Dorg.eclipse.swt.browser.UseWebKitGTK=true
+
=== Display issues under Wayland ===
 +
When running Eclipse on Wayland, you may encounter rendering issues such as slow response time to mouse events or chopped dialog windows (Bug report [https://bugs.eclipse.org/bugs/show_bug.cgi?id=483545]). A possible workaround for this issue is to force Eclipse to run under XWayland.
  
If that does not work (or if you do not want to use libwebkit) try:
+
With the superuser, open the file {{ic|/usr/bin/eclipse}} and append this line before the {{ic|exec}} line :
 +
    export GDK_BACKEND=x11
  
-Dorg.eclipse.swt.browser.XULRunnerPath=/usr/bin
+
This will force the execution of Eclipse on XWayland.
  
=== Crash on first boot or when choosing "Help->Welcome" ===
+
== See also ==
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://www.ibm.com/developerworks/library/os-ecl-subversion/ How to use Subversion with Eclipse]

Latest revision as of 00:55, 29 September 2018

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.

Installation

Install one of the following packages:

You cannot install multiple of these at the same time since they conflict, see FS#45577: choose the package above which most immediately fulfills your needs, and then add support for any additionally required languages through #Plugins.

Plugins

Many plugins are easily installed using pacman (see Eclipse plugin package guidelines for further information). 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 Photon and the default update site for it is: http://download.eclipse.org/releases/photon. Go to Help > Install new Software > Add, fill the name to easily identify the update site later - for instance, Photon Software Repository - and fill the location with the url.

Eclipse Marketplace

Note: make sure you have followed the Add the default update site section.

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

Note: make sure you have followed the Add the default update site section.

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.

Note:
  • 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/lib/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 would not be recognized any longer.
  • Do not use Eclipse as root for your everyday work.

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.
http://avr-eclipse.sourceforge.net/wiki/index.php/The_AVR_Eclipse_Plugin || eclipse-avrAUR
  • Aptana — HTML5/CSS3/JavaScript/Ruby/Rails/PHP/Pydev/Django support. Also available as standalone application.
http://www.aptana.com/ || aptana-studioAUR
  • IvyDE — IvyDE dependency Manager.
https://ant.apache.org/ivy/ivyde/ || eclipse-ivydeAUR
  • Markdown — Markdown editor plugin for Eclipse.
http://www.winterwell.com/software/markdown-editor.php || eclipse-markdownAUR
http://pydev.org/ || eclipse-pydevAUR
https://github.com/subclipse/subclipse || eclipse-subclipseAUR
  • Subversive — Alternative Subversion support.
https://www.eclipse.org/subversive/ || eclipse-subversiveAUR
  • TestNG — TestNG support.
http://testng.org/doc/eclipse.html || eclipse-testngAUR
  • TeXlipseLaTeX support.
http://texlipse.sourceforge.net/ || eclipse-texlipseAUR
  • Checkstyle — Eclipse Checkstyle support.
http://eclipse-cs.sourceforge.net/ || eclipse-checkstyleAUR

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:

  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 "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

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.

Dark theme

Eclipse supplies a Dark theme which can be enabled in Window > Preferences > General > 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/.

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;
}

Disable GTK+ 3

When the SWT GTK+ 3 UI is buggy and sometimes unusable, You can try to disable the use of GTK+ 3 with the SWT_GTK3=0 environment variable when you start eclipse:

SWT_GTK3=0 eclipse

Another option to achieve the same effect is to add the following to /usr/lib/eclipse/eclipse.ini.

--launcher.GTK_version
2

Those two lines must be added before:

--launcher.appendVmargs

Freshplayerplugin

Eclipse is not compatible with freshplayerpluginAUR. See https://github.com/i-rinat/freshplayerplugin/issues/298.

Eclipse 4.6 may not open the marketplace properly

See this bug. You can take following two steps to fix it:

eclipse -consoleLog -application org.eclipse.equinox.p2.director -uninstallIU org.apache.httpcomponents.httpclient/4.3.6.v201411290715
cd /usr/lib/eclipse/ && sudo rm plugins/org.apache.httpcomponents.httpclient_4.3.6.v201411290715.jar

Show in System Explorer does not work

See this guide. Go to Window > Preferences > General > Workspace and change the command launching system explorer. As Xfce user you may like to change it to thunar ${selected_resource_uri} to open the selected folder with thunar.

Display issues under Wayland

When running Eclipse on Wayland, you may encounter rendering issues such as slow response time to mouse events or chopped dialog windows (Bug report [1]). A possible workaround for this issue is to force Eclipse to run under XWayland.

With the superuser, open the file /usr/bin/eclipse and append this line before the exec line :

   export GDK_BACKEND=x11

This will force the execution of Eclipse on XWayland.

See also