Broken by design, I guess
Publish date: April 3, 2012Sometimes I have to jump through so many hoops just get something working, I just have to write it down. Especially because I just know that somehow, somewhere, somewhen, I’m going to have to do it again. Especially in software that I assume should work out of the box, seeing as it’s so popular. Or maybe I just don’t do things the “normal” way and it’s really just me. shrug
Working on Mono for Android, sometimes I can’t escape looking at java. It was only today that I’ve actually had to build things with something other than ant, so I had to install Eclipse. I really favour command line tools over running an IDE, though, so I went on a hunt to find out how to build Eclipse projects from the command line.
I found a few topics called Headless Building and Batch Compiler, which looked promising. Of course, the executable required for the first is completely missing in my installation (Eclipse Classic 3.7.2), so I tried the ant variant next (some StackOverflow posts pointed to that being a decent solution for this). It immediately crashed with
[apt] Warning: NLS missing message: JdtApt_noWorkspace in: org.eclipse.jdt.apt.core.build.messages [apt] Warning: NLS missing message: JdtApt_noEclipse in: org.eclipse.jdt.apt.core.build.messages [apt] Warning: NLS missing message: JdtApt_noStartupJar in: org.eclipse.jdt.apt.core.build.messages
The last one was also an error and the build failed. A quick search on JdtApt_noStartupJar revealed this. Note line 54:
startupJar = new File(file, "startup.jar"); //$NON-NLS-1$
Soooo… startup.jar? There’s nothing like that in my eclipse folder. Another quick search reveals this short but enlightening post, which basically says that startup.jar hasn’t existed in Eclipse since at least 2009 (looks at the calendar and sighs) and that the solution is to replace all references to that file to “$ECLIPSE_HOME/plugins/org.eclipse.equinox.launcher_version.jar”.
Since I can’t just go and change the paths on that apt plugin thingy, I instead went and symlinked the new file to a startup.jar in the Eclipse directory. Et voilá, things work.