Eclipse
From Gentoo Linux Wiki
This article is mainly written by Elvanör (elvanorATgentoo.org), the current maintainer of Eclipse on Gentoo. Thus "I" refer to myself, and "We" to the Java herd in general.
Contents |
[edit] General
- The Eclipse IDE is available on Gentoo via the portage package eclipse-sdk. This package is the "standard" Eclipse distribution which includes the Eclipse platform itself, Eclipse plugin development tools, and Eclipse's Java Development Tools (JDT). Other tools and addons including IDEs for C++, PHP, Ruby and others can be easily obtained through Eclipse's Update and Addon manager which is accessible from the help menu.
- Eclipse 3.3 Europa is in Portage, in ~x86/~amd64. We will stabilize as soon as possible. I know that the ebuild has been long coming to the main tree, mainly due to the fact that there was no dedicated maintainer until I became a Gentoo developer in early 2008. This is also due to the fact that a lot of work has been put on the ebuild, that should however on the long term make Eclipse more maintainable. See below for more information.
[edit] What is Eclipse?
Eclipse is a free software / open source platform-independent software framework for delivering what the project calls "rich-client applications", as opposed to "thin client" browser-based applications. So far this framework has typically been used to develop IDEs (Integrated Development Environments), such as the Java IDE called Java Development Toolkit (JDT) and compiler that comes as part of Eclipse (and which are also used to develop Eclipse itself). However, it can be used for other types of client application as well.
[edit] Eclipse series
- We currently support version 3.2.x of the Eclipse project.
- However, all my attention is focused on 3.3 at this point, so a lot of the old 3.2 bugs will be only fixed in 3.3.
[edit] Eclipse 3.2.x
- Eclipse 3.2 is currently available through portage.
- One of the dependencies for 3.2 is Java 1.5. If you have problems relating to this (or other java dependencies), information on HOWTO configure java correctly on Gentoo is located here and HOWTO update your java system here. You may also need to define MOZILLA_FIVE_HOME environment variable for the eclipse browser to work properly (eclipse FAQ).
- If you are running 3.1.x, Gentoo Java team strongly suggests you to upgrade to Eclipse 3.2.x. Plugins may be safely installed using Eclipse upgrade facility, without the need of any tricks (such as running Eclipse as root).
[edit] Eclipse 3.3.x
- Eclipse 3.3 Europa is finally available in Portage, in ~x86/~amd64..
- Eclipse 3.3 requires Java 1.5. Some plug-ins, such as the PDT Project, require the Sun JVM. Check with the plug-in maintainers for JVM requirements. Information on HOWTO configure java correctly on Gentoo is located here and HOWTO update your java system here.
- To change some configuration settings, there is now an /etc/eclipserc file (system-wide) as well as a ~/.gentoo/eclipserc one (for each user). These plain Bash files are sourced when Eclipse is started. Currently they allow you to tweak memory settings. This is the current recommended Gentoo-way of changing the Eclipse startup option. The normal way, editing an eclipse.ini file, has been abandoned.
- The Eclipse-3.3 ebuild has seen major changes from the previous 3.2 version. It now uses almost only Gentoo Java dependencies, as opposed to using only the Eclipse bundled jars. A few jars remain bundled, and we'll work on this in the future. We may also attempt to modularize Eclipse if time allows this effort.
[edit] Extensions in Eclipse
Eclipse is extended through features and plugins. Features are a collection of one or more plugins. We use the term extension as an abstraction over both, when the difference is irrelevant.
[edit] Installing new extensions
Currently the recommended way of installing extensions is to use the integrated Update Manager by selecting Help -> Software Updates -> Find and Install within Eclipse. With that mechanism you are free to install plugins and features to your home directory. In fact, you can install extensions wherever your user has write permissions, subject to some rules:
- You can freely upgrade the extensions managed by the Update Manager.
- Extensions installed by Portage must be updated through Portage.
[edit] Using extensions installed by Portage
Currently, all extensions compiled from source code are automatically available in your workspace (on next restart of Eclipse if you merged new extensions while Eclipse was running).
[edit] Details on extensions
The features and plugins managed by Portage, however, will be installed in fixed locations.
All extensions that are compiled entirely from source code will be installed into the main Eclipse library, located in /usr/lib/eclipse-2 (or -3) or /usr/lib/eclipse-extensions-2 (or -3).
All extensions where the .jar files are installed as-is, so-called binary packages, will be installed into /opt/eclipse-extensions-2 (or -3).
This means that any from-source extension will be automatically available inside your Eclipse environment, but you must explicitly link the directory /opt/eclipse-extensions-2 into your workspace using the Update Manager if you want to avail yourself of the binary extensions. Go to Help->Software Updates->Manage configuration and add /opt/eclipse-extensions-2 as an extension location.
This linking only needs to be done once for every workspace. New binaries will automatically show up when merged after the initial link has been set up.
[edit] Reporting bugs
- Eclipse is currently maintained by Elvanör (elvanorATgentoo.org), and by the Java herd in general.
- If you have problems, try contacting us on #gentoo-java on irc.freenode.net or subscribe and mail your woes to [gentoo-java@lists.gentoo.org]
- If you think you've found a bug, report it through bugs.gentoo.org. Eclipse can be used in such a variety of situations that I cannot discover all the problems myself. Thus bug reports are very valuable, especially if I can easily reproduce them thanks to your input.
If you decide to report a bug upstream with the Eclipse project, you should make certain that:
- Your entire system is built with safe CFLAGS. This means you can only use -O2, -O3 and -march=x, -mcpu=x as optimization CFLAGS. In particular, you cannot use -fomit-frame-pointer, as this makes debugging JVM crashes impossible.
- You have verified that it is not a Gentoo-specific problem. Join #gentoo-java and ask, or mail gentoo-java@lists.gentoo.org.
[edit] Problems and Solutions
- Eclipse is slow, or very unstable (Out Of Memory crashes)
- This most likely means that you need to increase the memory allowed to Eclipse. Edit /etc/eclipserc and change some variables. This is especially needed if you are on amd64, or use a lot of Eclipse plugins. Note that if given enough RAM, Eclipse should *not* be slow. However, it will always be slower on amd64 than on x86, as Sun unfortunately does not provide a 64-bit client mode JVM, so everything is ran in server mode which is not adapted to applications such as Eclipse.
- Printing does not work in Eclipse
- Rebuild swt with the cairo USE flag set.
- Embedded browser does not work in Eclipse
- See | The eclipse faq
Basically just build dev-java/swt with the xulrunner flag (this will pull xulrunner), and upgrade to Eclipse 3.3 or newer.
Method for older versions that didn't work for me (Can someone provide more details on that or confirm that it works please):
Ensure MOZILLA_FIVE_HOME is set correctly (Example: /usr/lib/seamonkey or /usr/lib64/xulrunner) and rebuild dev-java/swt with the correct USE flag set (firefox, seamonkey, xulrunner).
- Eclipse hits 100% CPU usage and freezes on start-up with GTK GUI
- Tune down your CFLAGS. In particular, do not use -msse and/or -msse2
- Javadoc Tooltip
- To get the Javadoc Tooltips goto Window->Preferences->Java->Installed JREs->edit, mark rt.jar and attach the source : /opt/sun-jdk-1.4.2.08/share/src.zip or the appropriate.
- Docs error
- Eclipse assumes you have Mozilla installed and I use Opera. I couldn't find a way (config file or such) to change the default so I simply created a link mozilla > opera.
- cd /usr/bin/
- link opera mozilla
[edit] Thanks
- People to thank include karltk@gentoo.org, nichoj@gentoo.org (previous maintainers), ali_bush@gentoo.org and geki for initial help on the ebuild.
