Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 13 Next »

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 or 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.

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:

http://subclipse.tigris.org/update_1.6.x

Step 3.c: 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

-Djava.library.path=/usr/lib/jni

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

-Djava.library.path=/usr/lib/jni

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 Groovy-Eclipse into your 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:

http://dist.codehaus.org/groovy/distributions/greclipse/snapshot/e3.6/

Alternately, the following update site can be used to get the latest release, but this might be a bit outdated:

http://dist.springsource.org/release/GRECLIPSE/e3.6/

In STS it can also be installed via the Dashboard from the Extensions Tab.

Step 5: Checkout Source from SVN

In SVN repository explorer: Add SVN repository location: https://svn.codehaus.org/groovy/eclipse

  • trunk
    • base (contains plugins for compiler integration)
      • org.codehaus.groovy
      • ...
    • base-test (contains plugins that test the compiler integration)
      • org.eclipse.jdt.groovy.core.tests.builder
      • ...
    • extras (contains groovy-eclipse and maven integration along with other projects)
      • ...
    • ide (contains ui plugins)
      • ...
    • ide-test (contains ui test plugins)
      • ...
    • jdt-patch (contains the JDT core patch plugins...only check out the branch corresponding to the eclipse version you have as your target environment)
      • e36
        • ...
      • e37
        • ...

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:

  • AllGroovyTests.java
  • GroovyJDTTests.java

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:

  • No labels