September 24th, 2009
John
Here’s one I spent a day learning: OS X 10.6 “Snow Leopard” has no Java 5 installed, despite appearances to the contrary.
The Java 1.5 installation is actually a symbolic link to the Java 1.6 installation. There is a fix available, which essentially entails copying the Java 1.5 installation from a Leopard install, and fixing up the symlinks. It’s available here.
I found this because we have a product which must be linked against Java 1.5, or rather, the JDBC version 3 specification. We don’t yet support all the extended functionality of JDBC 4.
In Eclipse, I had selected Java 5 (= JDBC 3) as the JRE, but was still getting lots of “method unimplemented” errors for JDBC 4 (= Java 6) signatures. These aren’t present in Java 5, so they should not have appeared.
After unfolding the JRE Library node in the Eclipse Package Explorer, it was clear that, although the JRE was reporting itself as Java 5, the jars within were clearly coming from Java 6.
I applied the fix and the compiler errors disappeared – Java 5/JDBC 3 was in use again.
For (my) future reference, here are the JDK / JDBC versions:
- JDK 1.1 → JDBC 1.2
- JDK 1.2 → JDBC 2.1
- JDK 1.4 → JDBC 3
- JDK 1.5 → JDBC 3
- JDK 1.6 → JDBC 4
Two awesome plugins for those of us using Eclipse on screens with low resolutions:
Also to consider:
- Is your editor font too big? Can you make it smaller and still be comfortable working with it?
- Look at your window layout – do you have a view docked to the right of the editor – probably Outline? Do you really ever use outline? Get rid of it if not, or make it a tab in the dock on the left.
An incompatibility between Java source versions in Eclipse made a generics error show up as:
Type mismatch: cannot convert from Object to ILocationService.
when it should really have read something like:
Type mismatch: return type of TypeLoader is generic – this project is not.
Read more…
Tooltips in Mac OS X display, by default, after 2 seconds. I find this is ample time in the general operating system, but in Eclipse it’s an eternity. Eclipse uses Tooltips in the Java tooling to display all kinds of useful information, not the least of which is the javadoc for the element and the source. Waiting for these is frustrating.
The general workaround of using OS X defaulting to change that didn’t work with previous versions of Eclipse because the SWT (IBM’s excellent widget set) was built on Carbon, OS X’s “UI Compatibility Library”, which ignored the default. Eclipse is now available for Mac in a native Cocoa version, which does take the defaulting into account.
Here’s how to change the global OS X tooltip delay (in Terminal):
defaults write -g NSInitialToolTipDelay -int 100
I personally want to keep the 2-second delay for everything except Eclipse, so I applied the default just to Eclipse using the Eclipse bundle name:
defaults write org.eclipse.eclipse NSInitialToolTipDelay -int 100
The delay time is in milliseconds. You might have to log out and back in again to make the default take, but usually restarting Eclipse does the trick.
Nice work IBM!
We’ve had an issue with our Eclipse-based application which would cause it to slow down exponentially under stress test. The problem lie in the job management system: new fast code could essentially cause it to bog down under the weight of update jobs.
Read more…
If you use Eclipse with lots of plugins, eventually you might get into a situation where the Software Updates ‘feature’ doesn’t work any more. It will find updates okay, but when you come to install them, you’ll get a message which reads something like “No repository could be found containing bundle…”. I think I’ve solved this problem.
Read more…

A programmer realised he had a problem which could be solved using threads.
Now he has two problems.
This isn’t going to be an anti-thread post, but I do want to sound a few words of caution about threads, and, specifically, synchronizers and monitors, and the order in which you acquire them.
Read more…