Sunday, June 18, 2006

Debugging Java used in Cocoa apps with the Objective-C Bridge:

In relation to some work I was doing with Adium, I became frustrated at the lack of any way to deal with debugging java classes that are used via the Cocoa-Java bridge. In a moment of desperation, I sought out various means of debugging or profiling, and I accidentally found a valid solution:

to the JVM arguments as specified in your application's Info.plist.
The way to do this is as follows:

You can then connect to the application using the java debugger of your choice, the line to do this with jdb is
jdb -attach 8000

I've heard that I should try using something like Eclipse, so if you aren't up on debugging in the Java world I guess it's worth giving that a look. I've also heard good things about IntelliJ, but that costs a reasonable chunk of money.


Post a Comment

<< Home