Building Groovy Eclipse in Eclipse on Ubuntu 10.04
Below is a step-by-step list of instructions that takes you through the process of setting up an Eclipse environment for building the Greclipse plugin.
These instructions where written while going through the process on an Ubuntu 10.04 machine. So in places they are specific to that environment.
If someone tries these instructions in a different environment (say Mac OS X or Windows) it would be nice to provide a copy of this page with appropriate modifications for those environments.
Step 1: Install Eclipse
Install one of
- Eclipse for RCP/Plug-in Developers (183 MB)
- Ubuntu note: Don't install Eclipse from the Ubuntu repositories download it manually from eclipse.org instead.
- Eclipse STS pick and install the package appropriate for your OS.
I prefer to install Eclipse RCP instead of STS. The main reason is that the RCP plugin environment comes with all the source code for JDT plugins, which is quite useful while working on Greclipse, which heavily subclasses from JDT.
Step 2: Install Subversion on your machine
We'll need to checkout the Groovy sources from SVN. There are two options available for installing Eclipse support for subversion.
- Subversive from the Eclipse.org repositories (recommended)
- Subclipse from http://subclipse.tigris.org/
Note: For Subversive, it is possible to skip this step (OS install of subversion) entirely as there is a "Full Java" version of the backend libraries. I recommend this option since it is the easiest, most painless install process. If you choose this path, skip to Step 3.
In Ubuntu (10.04):
Open Synaptic and search for subversion.
I found and installed both of the following:
- subversion 1.6.6
- libsvn-java 1.6.6
Step 3: Install Eclipse support for Subversion
If you have something already installed, you may just want to go with that. Otherwise choose either Subversive or Subclipse and follow instructions below.
Step 3.a: Subversive Install
To install subversive, you go through the Galileo update site (under "Help >> Install New Software"). You don't need to add it, it should already be there (with a standard install of Eclipse or STS). Under the Collaboration category find and install:
- Subversive SVN Team Provider
- Subversive SVN Integration for the Mylin project (optional)
After installing these and restarting Eclipse, you will be prompted to install an SVN connector package. Pick a version that matches your install of subversion (e.g. I installed the JavaHL 1.6 connector to match the version installed in my OS). If you chose to go with the "pure java" option rather than native libraries, pick the most recent "full java" version (1.1.7 at the time of this writing, for Eclipse 3.6).
Step 3.b: Subclipse Install
As an alternative to Subversive you can install Subclipse instead. (Note: It is probably a bad idea to install both of them at the same time)
Before installing Subclipse, check which version you need to install. Essentially it depends on which version of subversion and the JavaHL library you have installed in your OS. It is recommended to get the more recent version of JavaHL and SVN to be able to install the more recent version of subclipse plugin.
With version 1.6.6 of the JavaHL (libsvn-java) we need to install the corresponding Subclipse version: 1.6.x.
This can be installed from the Subclipse 1.6 update site:
Step 3: Eclipse Java Library Path
If you are on Linux, and you did not choose the "pure Java" install, you may still need to tell Eclipse (or STS) about the installed JavaHL libraries. If you chose a pure java SVN install you can skip this step.
Ubuntu 10.04 with Eclipse RCP
Add the library path into the eclipse.ini file in the eclipse installation directory. In my case, I manually installed Eclipse into my home directory so I added
to the end of ~/Applications/eclipse/eclipse.ini
Make sure this line is placed somewhere after the -vmargs line.
Ubuntu (10.04) with STS (2.3.2)
Add the library path into the STS.ini file in the STS installation directory. In my case, I manually installed Eclipse into my home directory so I added
to the end of ~/Applications/springsource/sts-2.3.2.RELEASE/STS.ini
Make sure this line is placed somewhere after the -vmargs line.
You may want to check whether the JavaHL library is properly installed: in Eclipse Preferences >> Team >> SVN >> SVN Connector it should display the version of the library if it is properly installed.
Note: The "win32 only" comment in the version info seems untrue, things work just fine under Linux, so just ignore it.
Step 4: Install GREclipse (Groovy Eclipse)
Some of the projects contain Groovy code, so we need to have Groovy support installed.
Preferably, the latest version of Groovy Eclipse should be installed, which can be obtained
from the update site for the latest snapshot:
Alternately, the following update site can be used, albeit an older version:
In STS it can also be installed via the Dashboard from the Extensions Tab. (I have not tried this method)
Step 5: Checkout Source from SVN
In SVN repository exlorer: Add SVN repository location: https://svn.codehaus.org/groovy/eclipse|\
Under trunk, we find the following structure. (Currently, trunk contains the code for Eclipse 3.6, if you want the Eclipse 3.5 stream, check out the code under branches/E35 instead, you will find similar tree structure under there).
Each of the directories base, base-test, extras and ide contains a number of eclipse projects. Check out all the projects except those in extras. You must select only the projects (e.g. org.codehaus.groovy), but not the directories base, base-test, ... themselves.
This can be done easily as follows: You can select multiple projects by control-clicking on each project. When all projects are selected do a "check out as project" (subclipse) or "check out" (subversive) to check them out all at once.
Step 6: Run the tests
Do Run As->JUnit plugin test on org.codehause.groovy.alltests.
Note 1: There are two separate sets of tests in alltests plugin:
At the time when I wrote this, *running both test suites at once resulted in a number of test
failures* in the GroovyJDTTests suite. Running both the suites separately I got no such failures.
Note: If you get an Out of Memory Error like this (I got this in STS)
You can increase the size of PermGen space in "Run As -> Run Configurations"
Add this to VMArguments: