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.
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. If you want to learn more about Eclipse you should take a look at the project's website.
Eclipse in Gentoo
The Eclipse IDE is available on Gentoo via the portage package dev-util/eclipse-sdk. This package is the "classic" 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. There is currently no plan in packaging these for Gentoo.
The Gentoo Java team always tries to provide the latest version of Eclipse through the portage package. Due to the fact that Eclipse is a large product, the timeframe from a new Eclipse release till the point where it is provided in portage can be rather large.
Right now (2008-08-16) the stable version of Eclipse in portage is based on the 3.2 series (Callisto). Both 3.3 (Europa) and 3.4 (Ganymede) are also provided in the tree with the unstable keywords. The Gentoo Java Team will try to stabilize 3.3 as soon as possible and 3.4 after that. The 3.2 series will sooner or later disappear from the portage tree since the focus is now on 3.3, so a lot of the old 3.2 bugs will be only fixed in 3.3 or 3.4.
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 in the ebuild, that should however on the long term make Eclipse more maintainable. See below for more information.
Eclipse 3.2 (Callisto)
- Eclipse 3.2 (Callisto) 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 how to configure Java correctly on Gentoo is located here and how to update your Java system here. You may also need to define the MOZILLA_FIVE_HOME environment variable for the Eclipse browser to work properly (Eclipse FAQ).
Adding CDT Tools (or C/C++ IDE Plugin)
Instructions can be found within IBM's well written online article:
Eclipse 3.3 (Europa)
- Eclipse 3.3 (Europa) is available in the portage tree (unstable keyword).
- 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 how to configure Java correctly on Gentoo is located here and how to 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, for example. This is the currently recommended Gentoo way of changing the Eclipse startup option. Eclipse's default 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.
Eclipse 3.4 (Ganymede)
- Eclipse 3.4 (Ganymede) is provided in portage tree (unstable keyword). This version is lacking the update manager P2. There is also an ebuild in the java-overlay that provides this update manager. Instructions for installing this ebuild are found below.
- Eclipse 3.4 required Java 1.5 and has some support for Java 1.6.
- Everything else from the 3.3 part above also applies to 3.4.
Add the "java-overlay" using layman. (Please help clarify this process for me!)
# emerge layman # echo "source /usr/local/portage/layman/make.conf" >> /etc/make.conf # layman --fetch # layman --add java-overlay
After adding the java-overlay, unmask the following:
# ECLIPSE dev-java/eclipse-ecj dev-util/eclipse-sdk =dev-java/junit-4.4* =dev-java/ant-core-1.7* =dev-java/sat4j-core-2.0* =dev-java/ant-eclipse-ecj-3.4* =dev-java/swt-3.4* =dev-java/ant-1.7* =dev-java/javatoolkit-0.3* =dev-java/sat4j-pseudo-2.0* =dev-java/asm-3.1* =dev-java/ant-apache-bcel-1.7* =dev-java/ant-junit-1.7* =dev-java/ant-apache-bsf-1.7* =dev-java/ant-commons-net-1.7* =dev-java/ant-apache-log4j-1.7* =dev-java/ant-nodeps-1.7* =dev-java/ant-commons-logging-1.7* =dev-java/ant-swing-1.7* =dev-java/ant-javamail-1.7* =dev-java/ant-antlr-1.7* =dev-java/ant-trax-1.7* =dev-java/ant-apache-resolver-1.7* =dev-java/ant-jdepend-1.7* =dev-java/ant-apache-regexp-1.7* =dev-java/ant-apache-oro-1.7* =dev-java/ant-jsch-1.7*
# emerge eclipse-sdk
Adding CDT Tools (or C/C++ IDE Plugin)
A really nice thing about CDT Tools when comparing to Anjuta, after creating a simple Hello World project using one of the CDT templates, CDT would automatically build & debug with little hassle compared to using Anjuta's similar plugins. Hence, people just starting-out with Eclipse will get more coding done sooner then using Anjuta.
Once Eclipse-3.4 is installed, start Eclipse and go to the "Help" > "Software Updates" menu. Click "Available Software" tab and add the following site url:
Once added, check the tick box next to this entry and Eclipse will automatically query the server. (This might take awhile depending on the speed of your network connection, along with eclipse.org's bandwidth availability! Since eclipse.org site is stalling, I'm guessing the rest of this How To.)
After this, Eclipse should have a listing of available CDT related packages for installing. Check the tick box for the main CDT package/plugin and not the "Optional CDT Packages" (as you first have to install the main CDT package first), and select install.
You may have to restart Eclipse after CDT is installed.
I did run into one problem on the Welcome Screen of Eclipse. After clicking on "Getting started with C/C++ CDT" url, Eclipse failed with a complaint it could not start Epiphany or Mozilla (even though I had already configured Eclipse to use /usr/bin/firefox)!
The Eclipse ebuild depends on the dev-java/tomcat-servlet-api package, which in turn, requires virtual/jdk-1.4. If you want to avoid having to installing virtual/jdk-1.4, set the java5 USE flag on dev-java/tomcat-servlet-api, which will alter the dependency to >=virtual/jdk-1.5.
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.
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 (3.2 and 3.3) or Help -> Software Updates ... (3.4) 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.
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).
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).
(I'm not seeing any so-called /opt/eclipse* folders. Please Update for Eclipse-3.4!!)
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.
- 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 [firstname.lastname@example.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 email@example.com.
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
- Regular JVM crash with 64 bits Sun JDK in org.eclipse.core.internal.dtree.DataTreeNode.forwardDeltaWith
This is a bug in the Sun JVM. See https://bugs.eclipse.org/bugs/show_bug.cgi?id=214092 and http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6614100 You can install a 32 bits eclipse version, emerge app-emulation/emul-linux-x86-java and choose "Sun 32bit JRE 1.6.0.07 [emul-linux-x86-java-1.6]" using java-config
- "Cannot launch the Update UI. This installation has not been configured properly for Software Updates" error with Eclipse 3.4
- it seems the new update UI is not built due to some profiling issues with the current P2 sources however you can use the 'classic' update module via Window>Preferences>General>Capabilities>Classic Update. For more information see http://forums.gentoo.org/viewtopic-t-700492-start-0-postdays-0-postorder-asc-highlight-.html and http://dev.eclipse.org/mhonarc/lists/linux-distros-dev/msg00345.html. Alternatively you could try the java-overlay build via Layman which has the P2 update module working
- java.lang.UnsatisfiedLinkError, no swt-gtk-3448 or swt-gtk in swt.library.path, java.library.path or the jar file, at org.eclipse.swt.internal.Library.loadLibrary(Unknown Source)
Sometimes Eclipse can't find /usr/lib/libswt-gtk-3448.so. To solve that, edit /usr/lib/eclipse-3.4/configuration/config.ini and add the following:
- People to thank include firstname.lastname@example.org, email@example.com (previous maintainers), firstname.lastname@example.org and geki for initial help on the ebuild.
Created by NickStallman.net, Luxury Homes Australia
Real estate agents should list their apartments, townhouses and units in Australia.