Pimp Your Eclipse

Reading about Martin Fowler's pain in installing some Eclipse-based plugins I noticed one gem of information that probably needs to be more widely known, and that's about managing extensions in Eclipse.

I'd prefer to use IDEA on a project, especially on a large code-base, but with every release Eclipse gets that little bit better, to the point where it's actually not a bad place to be most of the time and has some novel features that make it even nicer. As an example, try hitting ctrl-3 in Eclipse 3.3 for a QuickSilver-like list of actions that could be performed from where cursor is right now.

Firefox allows the user to add new features by downloading and installing new features as "extensions". Eclipse also allows users to add new features and capabilities by downloading and installing "extensions" --- same word, same concept. Of course, Eclipse ships with a lot of functionality right out of the box (downloaded archive?) but being able to add new capabilities allows you to work more efficiently, and means that those of us with a deep love of the new and shiny can always pimp our IDE.

Eclipse is typically installed by simply unpacking the ZIP it was downloaded as and running the Eclipse binary directly. As an aside, this is a blissful way to install software; I'd much rather this than an installer script shoving files in new and interesting places on my hard drive, not least because it means I can check my IDE into my source control system. By default, Eclipse will install new plugins into its own directory structure. The problem is that it's now Not Terribly Easy(tm) to tell where the original Eclipse ends and the enhancements begin, making it hard to upgrade Eclipse itself. To get around this, Eclipse has the concept of "extension locations". These are directories that are also scanned by Eclipse for extensions, and they're extremely easy to set up.

Suppose you want to create one of these things? How do you go about it? Simply create a new directory, let's call it "eclipse-extensions" because we're feeling powerfully original. You could call yours "Fred" or anything you like. It really doesn't matter.

What does matter is that this directory has a sub-directory called "eclipse", which is turn has two sub-directories "plugins" and "features". The "eclipse" directory must also contain an empty file called ".eclipseextension". This can be hard to create a Windows box, which views that name as a file extension and gets a little huffy that you've not given the file a proper name. At this point, I normally break out the command shell and use some strong "rename-fu", but you're an intelligent person and can probably imagine a million different ways of doing this. Me? I'm already up to five different ways, and I've not stopped fiddling with iTunes to try and get it to play something other than hits from the 80s.

Now that the directory structure is in place, just fire up Eclipse, and go to the "Help->Software Updates->Management Configuration" screen. Right-click on the "Eclipse SDK" entry in the tree view on the left-hand side and choose to "Add->Extension Location" In order to add a certain air of mystery to the process, I'll not give away the ending, but I'll hint that you probably want to point towards "Fred"....

Once everything's in place, just remember to ensure that all extensions are installed into your brand spanking new extension location, which is an option when installing through Eclipse's wizards. Congratulations! You can now upgrade Eclipse without fear of forgetting which extensions you've already installed. Of course, you'll also have that sense of horror when the extension that makes your life worth living suddenly stops working as eclipse's internal extension API changes again, but that's a different problem and one that you'd have to face anyway.


Simon Stewart on Saturday, 28 July, 2007

Posted in: /java

Front End First and Project Velocity

*click* Another part of the XP way of thinking sinks in. I've been trying to develop "test first" for a while and found it to be slow going. I think that there were two reasons for this. Firstly, I was exploring a number of different ideas in code, and until those had been thrashed out nothing was going to go fast.

But I don't think that's the real reason for my slow project velocity. You see, as a developer, I love the intricacies of working on the back-end of the site. I'm fascinated by all the little moving parts, whirring in front of my eyes. Anyone who's ever written an appreciable amount of code must know this feeling, surely? But that's not the best way to get the speed up. The thing that's just clicked is that being able to show the end-user of your code something sooner rather than later isn't just to keep them happy. It's to keep you focussed on what you're doing.

I've just taken the time to start developing "front end first" by writing the JSP the way that I'd like it to be. This gives me the interface to my Webwork actions in the same way that TDD offers me a chance to write the interfaces to the other components. Once I know what the actions need to do, I can figure out what other pieces of the puzzle need some flesh to get things to work as expected.

Suddenly, I'm going a lot faster.

And apolgies for the snappy title.


Simon Stewart on Tuesday, 11 March, 2003

Posted in: /computing /java

JDK 1.4.1 for OS X

I've been running the developer previews of Java 1.4.1 for some time, and on the server-side it's been fine, although there have been a few glitches. And now Apple have finally gone and released a final version.

Judging by some of the bug reports on the (NDA'd) support list, I'm not sure that it's quite ready for prime-time, but I also don't think that Apple could have waited much longer, with Tiger looming on the horizon if they still wanted to be considered serious about Java.

Just about to reboot. I'll let you know what I think in the next few days :) Can anyone tell me if IDEA 3.x runs properly, please?


Simon Stewart on Tuesday, 11 March, 2003

Posted in: /java

Hibernate Mapping Madness

Here's my wild and crazy idea, which'll only make sense to people who have used Hibernate. Why not extend MapGenerator to also read the source for the classes it examines (if available) and hunt out the XDoclet tags meant for the HibernateDoclet task?

This allows for at least two things:

  • The graceful handling of abstract parent classes (I happen to like the way that MapGenerator deals with them)
  • Give complete control over how the generated mapping does table and column names (which is why it's not advisable to use MapGenerator without faffing with the generated files)

The Hibernate XDoclet task has some known limitations (especially when handling composite keys) that I don't think that MapGenerator suffers from (though I could be wrong!)

In fact, it should be possible to write something like MapGenerator that relies on QDox to do all the analysis without having to compile the code at all or rely on reflection. Argh! If only there were time to do that!


Simon Stewart on Monday, 17 February, 2003

Posted in: /computing /java

Eclipse Help Required

Now, I'm more than happy to use emacs and ant to do all my work in (and frequently do) but so many people tell me that an IDE would make my life better in every way shape and form that I thought it was time to listen them. Again, because I occasionally flirt with them. Eclipse M5 has recently been released, so I decided to pick it up again. The fact that my primary machine runs OS X and the developer preview of the JDK 1.4 which has some "issues" with IDEA 3 has nothing to do with it :)

First question, if I have imported some code from CVS in Eclipse, how do I manage to convert the new project to a java project? Or should I ditch the entire thing and re-import it "properly" this time?

I see that MockMaker has an eclipse plugin, which solves one of my problems, but if any readers of this blog have some "getting started with eclipse" tips, then I'd appreciate a comment below!


Simon Stewart on Thursday, 13 February, 2003

Posted in: /java

Apple: Really Quite Good, Actually

What a great level of customer service is it that I can log a bug with Apple about the UI of OS X and have a response sitting in my inbox the next day? Okay, it asked for more information, but within 20 minutes of sending that information a real human had read it and "forwarded it on to the appropriate engineering team" (as well as getting an automated response too) All I ever get from MS are slow (if any) responses and endless spammed questionnaires asking if their service was okay. Ditto Oracle and Weblogic, but they approach me through lackies and salesmen. The Apple response is more like one of the better Open Source mailing lists (Hibernate's, for example)

Frankly, I'm impressed with the way that Apple are starting to focus on providing a better service to their customers. Not only are the Apple guys on the mailing lists I'm on unfailingly polite, but they're also helpful (which I suppose they should be, but not entering flame wars or rising to some of the baiting is a Good Thing)

They've also got some bright souls working for them, who are dedicated to what they do (Dave Hyatt springs to mind straight away) and they make some of the most desirable computer kit on the planet.

So a public "pat on the back" for Apple, then. Now, all they need to do is get JDK 1.4.1 out to an eagerly waiting public (I've got the developer preview, but it's just not the same as an official version)


Simon Stewart on Tuesday, 11 February, 2003

Posted in: /computing /java

Compiling Within Emacs

I've been using emacs ever since university (not that long, but long enough) and thought that there must be a neat way to persuade it to help with java development in the same way it copes with C/C++ dev work. For those of you not in the know, emacs and the GNU tool chain combine fairly seamlessly; it's possible to call gcc from within emacs, and then jump to any file and line that reports a compilation problem by just moving the cursor to the right place and hitting return. Very nice.

After a little hunting on google, here's how I now do it:

  M-x compile

When asked for the path to the make command, try

  ant -find build.xml -emacs

I'm using jikes as my compiler, so have to add "build.compiler.emacs" to my ant properties. And that's it. Nice and easy.


Simon Stewart on Thursday, 06 February, 2003

Posted in: /computing /java

Test Infected

I've been playing with linking Prevayler and WebWork together in the "next generation" of a website I'm working on (occasionally persisting to a database so the data is easy to use by other programs) I thought that it was going well.

The key word there is "thought" After doing a little browsing of the current app, I noticed that some data just wasn't being persisted properly. No problem, the XP crowd shout, just write a unit test that displays the bug and then write just enough code to make it pass. It's only now that the wisdom of those words, which I always appreciated on an intellectual level, sinks further into my programming mind.

Of course, looking on the bright side of this current exercise, I'm going to be left with a trail of tests that document not only the system, but what I've done to fix it, including how I got there. In addition, there'll be a safety net ready for the next time I bug surfaces. And I get the challenge of rooting through the code, cleaning it up and generally making the world a brighter place.

Yeah, test infected makes a lot of sense.


Simon Stewart on Thursday, 06 February, 2003

Posted in: /java

Language of the year

Joe speaks sense. Again.

The Pragmatic Programmer suggests learning a new programming language (at least) once per year.

...

So, which one should it be? How will they change the way I think? What will you be learning this year?

[Joe's Jelly]

It's been on my list of Things I Want To Do for a while, so I'll choose Ruby as this year's language. I saw my parents yesterday and they gave me a belated Christmas present: the Pragmatic Programmers' Programming Ruby, so it looks fated, AFAIAC.

I wouldn't mind the time to improve my (almost negligable) Prolog knowledge too, but there's only so much time in the day.

Oh, and Joe, you might be interested in JRuby


Simon Stewart on Monday, 03 February, 2003

Posted in: /computing /java /play

mod_proxy and mod_rewrite

Just spent a part of the day reading the docs and playing, and have come to the conclusion that mod_proxy and mod_rewrite are simpler to set up than jk, jk2 or mod_webapp and just as effective, if not more so, because you're not tied to using Tomcat (well, Jetty has a JK adapter too, but *shhh*)

For those of you out there looking to see how it's done, take a look at the Proxy Support HOWTO over at the Jakarta site. Use this technique when you need to pass through whole sub-directories to your app server (take a look at your servlet-mappings in the web.xml file --- it should be obvious)

Where you have a servlet mapping that matches a postfix (such as "*.jsp") you'll need to write a mod_rewrite rule that redirects that URL to the proxy. For example, I am currently using:

RewriteRule ^/(.*\.jsp.*)   http://localhost:8080/$1  [P,L]

to pass any requests for JSPs to the localhost, and this seems to do the trick.

BTW, I assume that I have to match after the postfix in case the JSESSIONID is appended to it. If I'm deluded or just plain wrong, can someone please comment?


Simon Stewart on Thursday, 23 January, 2003

Posted in: /computing /java /work

Older posts: 1 2 3

Categories