I recently had an adventure trying to get a plugin, PDT, installed into my Eclipse software development environment. Diagnosis was hard, and the conclusion was non-obvious, though in hindsight, reasonable. It is that if you want to use an Eclipse plug-in that requires Java SE 6 on a Mac OS X 10.5.8 computer, you will need the 64-bit version of Eclipse.

Let me explain.

My main development computer is a rather old Macintosh running Mac OS X 10.5.8. My main software development tool is the Eclipse IDE (Interactive Development Environment). Eclipse allows you to install plug-ins which add support for various programming languages, databases, frameworks, and software methodologies. I went on a Prolog programming jag, and so I installed an Eclipse plug-in for Prolog development called Prolog Development Tool (PDT), from the University of Bonn.

I had a problem, though. PDT would not appear in my copy of Eclipse. I could see that the plug-in was installed, but it didn’t help me edit Prolog language code, it didn’t put up a Prolog console, its Prolog debugger wouldn’t work. So I set about trying to figure out why.

There’s a great set of instructions at  Where Is My Bundle for this situation. Lars Vogel’s tutorial, Extending Eclipse – Plug-in Development Tutorial, also helped me. I won’t go into the full details of what I explored. I will mention that what got an OSGI console for my running Eclipse was the command line,

$ cd /Applications/eclipse ; ./eclipse -console -consoleLog

The OSGI command, “ss cs3”, showed me that PDT was made up of about a dozen individual plug-ins, that they all had internal names starting with “org.pdt”, and the PDT plug-ins appeared to be installed. The OSGI comman, “diag”, showed that all the plug-ins depended directly or indirectly on a plug-in named,

plugins/org.cs3.pdt.common_1.0.0.201204241513/

And looking in file META-INF in that plug-in’s directory tree:

/Applications/eclipse/plugins/org.cs3.pdt.common_1.0.0.201204241513/META-INF/MANIFEST.MF

I saw this telling entry:

Bundle-RequiredExecutionEnvironment: JavaSE-1.6

Eclipse, and many or most of its plug-ins, are implemented in the Java programming language. Java comes in versions; the version which came with my Mac was the Java runtime environment version 1.5, also known as Java SE 1.5 or Java SE 5. I confirmed this by the command line test, % java -version. I learned that the PDT required Java SE 6, while I only had Java SE 5. Time to upgrade the Java SE.

I found two useful articles, Java 1.6 on Mac OS X 10.5? by Jason S. on Superuser.com, and Bill Burcham’s Upgrade OS X 10.5.8 to JDK 1.6. A short dance with Utilities/Java Preferences.app, and I now had Java SE 6 64-bit as my first-precedence Java environment, and J2SE 5.0 32-bit at the bottom of the list. Now % java -version reported itself as 1.6.0_26.

Full of confidence, I restarted Mac OS and went back to Eclipse. And discovered that PDT still didn’t load.  But, I was getting better error messages on the OSGI console within Eclipse.  They more clearly established that the problem was PDT not being able to get the JavaSE-1.6 environment it craved.

I turned to the distinction between 32-bit and 64-bit Java environments. Java Preferences.app seemed to be saying that only the 64-bit instance of Java was Java SE 6; my 32-bit instance was still still J2SE 5.0. Apparently the two coexist. Apple decided, according to a 2009 Apple Java-dev list message, that it wouldn’t ever make a 32-bit version of Java SE 5 for Mac OS X. They were moving the OS 10.6 to 64-bit, and all their OS X 10.5.8 users (except me) to 10.6, so we could all use 64-bit Java.  Now I did discover soylatte, a project to port a 32-bit Java SE 5 instance to Mac OS X 10.5.8, but it wasn’t effective in getting Eclipse’s attention.

Eclipse, it turns out, comes in 32-bit and 64-bit builds. What finally worked for me was to install the 64-bit build of Eclipse for Mac OS X, and find equivalents for all my plug-ins on the 64-bit Eclipse instance. When I did that, PDT began to work.

The conclusion I took away from this: if you want to use Eclipse 3.7 and a range of plug-ins on Mac OS X 10.5.8, you have to use the 64-bit version of Eclipse. This is because some of the plug-ins will probably require Java SE 6, and the only way to get that on Mac OS X 10.5.8 is from 64-bit Java applications…such as Eclipse.

I will eventually replace this old Macintosh, and when I do I’ll get a new OS, with a new Java runtime, and I’ll likely be all 64-bit (almost) all the time. But for now, this is my new rule of thumb:  Eclipse + Mac OS X 10.5.8 + Java SE 6 implies 64 bits.