Eclipse plus Mylyn = Productive

I tried Mylyn for the first time a year ago, and found it to be impressive, but the job I was working at had a relatively small team, and small codebase, and I was only using Eclipse/Java a portion of the time, so I found that I didn’t really use it too much. And after a couple of nasty crashes, I realized I had overloaded Eclipse with too many plugins, and yanked Mylyn out.

Now I’m working at a new gig, which is all Java all the time, and I am pretty much living inside Eclipse, flipping away only to check docs or go into DBVisualizer. And the code base is of a respectable size, divided into 50 or so source folders. My Package Explorer view just scrolls and scrolls and scrolls, and it is impossible to find anything. (Add to that that it is a new code base for me, and I just don’t know where stuff is, period.)

So suddenly, Mylyn is a lot more useful. It hooks into our issue tracker/ source repository (Trac/SVN). Which means I never have to leave Eclipse for information about what I am doing. I love the Planning tab on the tasks, where I can outline my approach to a problem, and which I can refer to when I lose track of what to do next.

My this is cool moment came when I discovered that Mylyn saved my workbench state for each task. Turning the task off cleans the workbench editor of all the files I had open—and making the task active again brings them all back. It’s fantastic to switch between issues, knowing that it won’t take you 15 minutes just to get everything set back up.

Best of all, Mylyn makes the Package Explorer usable again, by focusing me on just the files that I am using. I find Mylyn absolutely vital t o getting my job done these days.

One note: Getting started with Mylyn can be a little intimidating.  And for the first time user, the Mylyn project presentations are not especially helpful.  The 60 minute video done is a bit to long for the impatient to digest. There needs to be a simple 5 minute “here’s what’s cool, here’s how to get started”. If you are new to Mylyn, the best would be to get a demo from someone who has used it before. If you can’t get a live demo, I’d encourage you to stick with it though, it has definitely paid off for me.

Eclipse 3.4: JVM Terminated. Exit Code=-1.

After several months of using mostly Visual Studio, I have some time now to shift gears back into Java. The timing is good–the annual release of Eclipse and all its subprojects happened while I was out of town on vacation last month.

I’m working on a new computer, running Vista 64bit. I reaped the rewards of Moore’s Law by obtaining a custom build box with a Quad processor and 4 gigs of ram and a fancy graphics card for about 130,000 JPY. Oh yeah, a terabyte of storage. Anyway, the Core 2 Quad CPU was so reasonable I couldn’t not get it.

I’ve been using Vista for about 8 months and am still getting used to it. I am far from a Windows expert. And the ins-and-outs of 64bit versions of software I am still getting used to.

I discovered I had 5 version of Java installed on Vista: 1.5 and 1.6 in 32 bit versions, a 64bit 1.5 JRE (installed by Web Start?), and the 64bit 1.5 and 1.6 SDKs. I figured I would clean out the 32 bit versions. In fact, I wound up uninstalling every single version of Java and re-installing just the latest 1.5 and 1.6 SDKs, as there were updates that I didn’t yet.

Then I started up Eclipse and I got this really annoying error:

JVM Terminated. Exit Code=-1.

My environment: 64bit Vista Ultimate, Java 1.6 x86_64, Eclipse Gandymede (JEE zip download).

Google returned a lot of problems around Exit codes but nothing that specifically addressed this issue. Turns out the exit code just means “you’re out of luck!” I tried to find a list of all exit codes but had no luck. A lot of the advice about the exit code problem seems specific to Eclipse 3.3 and messing with the eclipse.ini settings (I recall vaguely having to do this about 7 months ago). That didn’t work.

After banging my head against the wall (needlessly), I realized that the Eclipse Gandymede default download is a 32bit download.  I had to find the Eclipse v3.4 64bit Windows download (which is a little tricky, because they do a good job of steering you to the Gandymede stuff–what you want is the Eclipse Platform download link), and then use the Gandymede update site to get all the subprojects downloaded correctly. Hurray for fiber to the home—it was not too painful to download all of it.

To summarize, I was having JVM Terminated because I was using a 32-bit binary of Eclipse on a 64bit Vista (32 bit Eclipse is in the default Gandymede download). The solution was to download a 64 bit version of Eclipse. Go to the Eclipse Platform Download link, then click on the “3.4” Build link to get to all the various binaries for all the platforms, including Win 64.

(I also wound up reinstalling a 32bit version of Java. Turns out, that is the Java used by Firefox and IE. Need that for viewing applets.)

Edited Aug 8, 2008: to make it clearer that the solution was getting a 64bit-compatible version of the Eclipse binary. Reinstalling 32bit Java was justa convenience to get my applets working in Firefox.

Maven and the “method does not override a method from its superclass” error

Spent more time than I care to admit today stuck on something soooo simple. Was trying to build a maven project at home, and kept getting this error: “method does not override a method from its superclass”.

What is happening? Well, there is a @Override annotation on one of the methods, but it doesn’t have a superclass–it is annotating a method that is being implemented (from an interface), not a method that is inherited (from a superclass).

The @Override annotation is a Java 1.5 feature, and the error message I was getting was coming (correctly) from a 1.5 compiler. However in Java 1.6 the @Override annotation can also be applied to methods that are implemented from an interface.

Someone started using Java 6 and Java 6 features in the project, without updating the pom.xml file to fix this. Grrr.

The fix was to update the configuration of the maven-compiler-plugin to use 1.6 as both the source and the target, rather than 1.5. set my JAVA_HOME to point to Java 1.6 and that was that. I wound up putting the config for maven-compiler-plugin back to 1.5. Which doesnt seem quite right, either, but fixes the UTF-8 error I am getting. Ugh!