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.
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.
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:
-
create a new Java project named
com.ibm.lab.usingjdt.helloworld and leave
Use default turned on.
-
Then Import from
File System.
-
Make the From directory: contain
/usr/web/eclipse-book-CD/Solutions/JavaProjects/com.ibm.lab.soln.usingjdt.helloworld.
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.
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.
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.
- Appearance
- Colors and fonts
- Basic
- Text Font
- click Edit...
- Set the Family to
Courier New
- Set the Typeface to
Regular
- Set the Size to
14
-
View and Editor Folders
This is the colors of folder tabs and the thin outline around.
Set the foregrounds to light colors, the background begins to dark colors
and the background ends to slightly lighter dark colors.
- Editors
- Text Editors
- Check Insert spaces for tabs
- Check Highlight current line
- Under Appearance color options:, set
- Select Current line highlight and set to dark blue, but slightly lighter than than the background dark blue
- Select Selection background color, uncheck System default, and set to dark green
- Select Selection foreground color, uncheck System default, and set to white
- Select Background color, uncheck System default, and set to dark blue
- Select Foreground color, uncheck System default, and set to white
- Spelling
- Uncheck Enable spell checking
- Keys
-
set the Scheme to Emacs
-
Note that on the Mac, most of the keyboard function keys
are bound to window-system functions. For example, F9 is Expose,
F12 is dashboard, etc.
Eclipse assumes that it owns the function keys.
By default, Eclipse says F9 means Undo.
I don't know how to solve this problem elegantly.
- Workspace
- Check Refresh automatically
- Check Save automatically before build
There are at least three Eclipse plugins for editing ANTLR files.
-
AntlrEclipse is no longer
supported, and it doesn't support ANTLR v3 anyway.
-
antlrv3ide seems the latest - it supports ANTLR 3.1.3.
-
AntlrDT is another one I tried.
It has a mode for ".stg" files as well as ".g" files.
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.
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.
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->Compiler
- set Compiler compliance level: to 1.6
-
Java->Editor->Syntax Coloring
- Under Element:, expand Java, set
- Select Abstract method invocations, check Enable, and set to White
- Select Annotation element references, check Enable, and set to White
- Select Annotations, check Enable, and set to bright green
- Select Auto(un)boxed expressions, check Enable, and set to White
- Select Brackets, check Enable, and set to White
- Select Classes, check Enable, and set to White
- Select Constants, check Enable, and set to bright yellow
- Select Deprecated members, check Enable, and set to White
- Select Enums, check Enable, and set to White
- Select Fields, check Enable, and set to Orange
- Select Inherited method invocations, check Enable, and set to Orange
- Select Interfaces, check Enable, and set to Orange
- Select Keyword "return", check Enable, uncheck Bold, and set to medium red
- Select Keywords excluding "return", uncheck Bold, check Enable, and set to Cyan
- Select Local variable declarations, check Enable, and set to White
- Select Local variable references, check Enable, and set to White
- Select Method declarations, check Enable, uncheck Bold, and set to White
- Select Methods, check Enable, and set to White
- Select Numbers, check Enable, and set to White
- Select Operators, check Enable, and set to White
- Select Others, check Enable, and set to White
- Select Parameter variables, check Enable, and set to White
- Select Static fields, check Enable, uncheck Italic, and set to White
- Select Static method invocations, check Enable, uncheck Italic, and set to White
- Select Strings, check Enable, set to Yellow
- Select Type arguments, check Enable, and set to Orange
- Select Type variables, check Enable, uncheck Bold, and set to White
- Under Element:, expand Javadoc, set
- Select HTML markup, check Enable, and set to Cyan
- Select Links, check Enable, and set to light blue
- Select Others, check Enable, and set to very light green
- Select Tags, check Enable, uncheck Bold, and set to Orange
- Under Element:, expand Comment, set
- Select Multi-line comment, check Enable, and set to Green
- Select Single-line comment, check Enable, and set to Green
- Select Task tag, check Enable, and set to light red
-
Java->Installed JREs
See the
"How to use Maven from Eclipse" section of my maven page.
-
Editor
- on the Syntax tab
- Indent tabs/spaces on indent: to 4
- on the Syntax tab
- Set the background color to dark purple
- Set the foreground colors:
- Default color to white
- Keyword1 and Keyword2 to cyan
- Comment1 and Camment2 to green
- Literal1 and Literal2 to yellow
- Mark Occurrence
- Uncheck the top box: Mark occurrescen of the selected element in the current file
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
- Main
- Under Appearance color options, set
- Select Code, set to white
- Select Decorators, set to bright yellow
- Select Numbers, set to bright pink
- Select Matching brackets, set to bright pastel green
- Select Keywords, set to bright cyan
- Select self, set to bright orange
- Select Strings, set to yellow
- Select Comments, set to bright green
- Select Backquotes, set to purple
- Select Class Name, set to pastel yellow
- Select Function Name, set to pastel yellow
- Interpreter - Python
-
In the Python Interpreters
section, click New...
The finder window that pops up won't let you select filesystem links, so
you can't choose /usr/bin/python. You have to open a Terminal window and
follow that link to its final destination, which for me was
/System/Library/Frameworks/Python.framework/Versions/2.5/bin/python2.5.
Then it'll ask you to select the libraries. I chose them all.
I was able to follow through with the remainder of the "Getting started with PyDev"
pages, except that code completion was bound to Ctrl+Period, not Ctrl+Space,
and Run was bound to Shift+Option+F11, not F9.
I found this out by dumb luck and hunting around the pulldown menus.
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.
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.
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.
To develop the TranslateCIM code, on 2009-05-16, I did:
- File->New->Java Project
- checked Create project from existing source
- browsed to set the Directory to ~/TranslateCIM.
- In Eclipse, in the Package Explorer, I navigated to
TranslateCIM->src/main/java/->com.kyben.translatecim/TranslateCIM.java
This opened the editor on the file, but there were lots of error
boxes on the right side of the code.
-
To fix it, I tried this, but it didn't work:
To add the maven repository to the classpath used by Elipse, in a Terminal window, I did
mvn -Declipse.workspace=~/.m2/repository eclipse:add-maven-repo
This chugged for a while and downloaded some stuff, and completed successfully.
-
Then I tried defining a "Classpath Variable" named M2_REPO, but that didn't
work either.
So I gave up on Eclipse again for now, damnit.
Pete Siemsen