Eclipse (Pete's notes)

As of 2009-05-09, I'm using Eclipse 3.5 M7. The method for installing plugins has changed, so some of the following may be out-of-date. I opened Eclipse Bugzilla issue 275589 to report that with I my color settings, I can't see the text cursor.

General

I found a great article on the web titled Beginning Eclipse for Advanced Developers.

I found a great article called Deploy an SWT application using Java Web Start, and I created a log of my experience trying to implement the example in the article.

The Eclipse book

To copy the CD-ROM that came with the Java Developer's Guide to Eclipse to my hard disk, I did this:

as root
mount /dev/cdrom /mnt
mkdir /usr/web/eclipse-book-CD
cp -r /mnt/* /usr/web/eclipse-book-CD
umount /mnt
chown -R siemsen /usr/web/eclipse-book-CD
chgrp -R datacomm /usr/web/eclipse-book-CD
chmod -R -w /usr/web/eclipse-book-CD

That last step is needed because it's easy to inadvertently delete or modify projects from within Eclipse. Ask me how I know. We don't want to modify our copy of the CD-ROM contents.

I added a link to /usr/web/index.html. Now the CD-ROM contents are at here.

The web page on the CD-ROM contains instructions for how to import the example projects from the CD-ROM into Eclipse. They won't work for 2 reasons: I'm running Eclipse 3 and the CD-ROM uses Eclipse 2, and the instructions are for Windows. Instead, you can create projects yourself and import specific java source files into the projects. For example, to set up the HelloWorld example used on page 656 of the book:

In the window below, you should see com.ibm.lab.soln.usingjdt.helloworld. Select it and you'll see several files in the right-hand window. Select HelloWorld.java from the right-hand window. Turn on the Create selected folders only button. Click Finish.

Installing

Web to http://www.eclipse.org/.

On 2009-05-09, I fetched eclipse-SDK-3.5M7-macosx-cocoa-x86_64.tar.gz. I untar'd it and moved it to /Applications.

To search the mail archives at www.eclipse.org, you need a password. See my Eclipse vendor page.

Customizing

Preferences

Some of these settings won't activate when you click OK - you'll have to restart Eclipse.

Eclipse preferences can be saved to a file and loaded into Eclipse. Do File->Export, then General->Preferences.

General

ANTLR and Eclipse

There are at least three Eclipse plugins for editing ANTLR files.
  1. AntlrEclipse is no longer supported, and it doesn't support ANTLR v3 anyway.
  2. antlrv3ide seems the latest - it supports ANTLR 3.1.3.
  3. AntlrDT is another one I tried. It has a mode for ".stg" files as well as ".g" files.

Antlr IDE

I went to http://antlrv3ide.sourceforge.net/. I couldn't figure out how to install it.

Here's my first attempt

I downloaded the .zip file and got ~/Downloads/eclipse, so I did

mv ~/Downloads/eclipse /Applications/eclipse/dropins
/Applications/eclipse/Eclipse.app/Contents/MacOS/eclipse -clean
...but that second line gave errors. I didn't see any evidence of ANTLR IDE in Eclipse.

Here's my second attempt

Then I tried using Eclipse's Help->Install New Software... I added http://antlrv3ide.sourceforge.net/updates, tried Test Connectian, the did Help->Check for updates, but it said "There is nothing to update". I didn't see any evidence of ANTLR IDE in Eclipse.

AntlrDT


Date: Fri, 21 Nov 2008 14:40:03 -0800
To: siemsen@ucar.edu
From: Support <support@certiv.net>
Subject: Re: [Support]

At 02:00 PM 11/21/2008, you wrote:

I'd like to try AntlrDT. I downloaded the plugins. How do I integrate them into Eclipse?

-- Pete

Best for third party plugins to go in the dropins folder

http://wiki.eclipse.org/Equinox_p2_Getting_Started#Supported_dropins_formats

Make sure that you have JDT and DLTK installed from the standard Ganymede Update Site. The DLTK core is listed under "Enabling Features" as the Dynamic Languages Toolkit core framework (0.95.1).

Restart with -clean is usually needed.


I loaded JDT into Eclipse by doing Help -> Software Updates, then selecting Ganymede -> Java Development -> Eclipse Java Development Tools. This added "Eclipse Java Development Tools" to the Eclipse Preferences.

Then I loaded DLTK (Dynamic Languages Toolkit) by doing Help -> Software Updates, then selecting Ganymede -> Enabling Features, then selecting Dynamic Languages Toolkit - Core Frameworks. This added "Dynamic Languages Toolkit - Core Frameworks (incubation)" to the Eclipse Preferences.

Then I loaded AntlrDT into Eclipse by doing

mv ~/Downloads/plugins /Applications/eclipse/dropins
/Applications/eclipse/Eclipse.app/Contents/MacOS/eclipse -clean
There was a now "AtlrDT" menu item in the Eclipse Preferences. Cool!

I opened a ".stg" file and got syntax highlighting. I loaded a ".g" file and got a stack dump, which I sent to the author of AntlrDT on 2008-11-23.

AntlrDT preferences

HTML and Eclipse

I don't know if I'll use Eclipse to edit HTML, but to try it I first loaded GEF into Eclipse. Then I got the Eclipse Editor for HTML as tk.eclipse.plugin.htmleditor_2.0.6.1.jar. I copied it to /Applications/eclipse/dropins and restarted Eclipse. I couldn't figure out how to set the foreground colors, so it's dark-on-dark, so it's useless.

I posted a question to the forum, and got this reply:

Subject:[#40531] RE: How to set EclipseHTMLEditor 2.0.6 colors?
Date:2008-12-10 13:22By:Naoki Takezoe (takezoe)

This is a bug of EclipseHTMLEditor. It will be fixed in the next release.

Thanks for your reporting.

So for now, to edit HTML with Eclipse, I'd have to edit a dark-on-white background. Sigh.

Java and Eclipse

Java preferences

Maven and Eclipse

See the "How to use Maven from Eclipse" section of my maven page.

Perl and Eclipse (EPIC)

Perl EPIC preferences

Python and Eclipse (PyDev)

To install PyDev, start Eclipse and pull-down Help->Software Updates... Add the pydev site (http://pydev.sourceforge.net/updates/) to the list of sites and install PyDev for Eclipse.

PyDev preferences

Django and Eclipse

See Configuring pydev to work with django To build the NETS contacts project, I did New->PyDev project and named it contacts. That created the directory, but not the Django part.

Remote System Explorer (RSE)

The RSE is a way to have Eclipse installed on one machine and use it to edit files on remote systems. It requires that a daemon be running on the remote system. I loaded RSE into Eclipse on okapi using the slick Eclipse download system, restarted Eclipse, and choose Window-> Open Perspective -> Other -> Remote System Explorer. Then I learned about the required daemon on the remote system. Not sure if I can make RSE work so that I can access SwitchMap files from okapi/galway.

Subversion (Eclipse mode for subversion)

I followed the directions for installing Subversive. It worked on galway, but I had some trouble on okapi, something to do with mismatched pieces. I gave up and uninstalled it. If I want Subversion integration I'll try subclipse instead of subversive.

Using Eclipse to work on TranslateCIM

To develop the TranslateCIM code, on 2009-05-16, I did:
Pete Siemsen