• Share this article:

OpenJDK in Eclipse

Tuesday, November 14, 2006 - 10:52 by Wayne Beaton

I decided to take a look at the OpenJDK today.

I directed my attention to the OpenJDK load instructions. There’s an omission in the instructions. They specify that the user name required to access the code is “$USER”. After several unsuccessful guesses at what this meant, I turned to the mailing lists and discovered that a valid java.net user id and password is required.

The repository doesn’t contain Eclipse project information, so some configuration was necessary (the Subversive plug-in has a handy feature that allows you to check out the code as a Java Project which saves us from having to mess with the .project file). I did have to determine which folders contain Java source and mark them as such so that Eclipse could compile them.

Eclipse JDT managed to compile javac with no additional configuration (using Java 5.0). Curiously, I haven’t yet been able to get the provided Ant build script to run (even more strange, I can get the Ant build to progress further in Eclipse than in NetBeans). I find it more than a little bit cool that I’m using the Eclipse compiler to build javac.

There are many tests included with the code. Unfortunately, the tests do not seem well organized (and after some preliminary tinkering, it doesn’t appear that many of them even work). The build file tests the compilation by having the results recompile itself. I love the metacircular stuff, but JUnit tests would be nice to have as well. Perhaps this will come in time.

Anyway, I have the javac code loaded and compiled and it seems to be working. I’m going to submit my .project and .classpath files as patches so that other Eclipse users can just load it and start playing immediately.