@IDWMaster: Yes I actually also have used similar mechanisms. I guess my main point was just that I'm surprised how hard Java makes it to do this stuff.
I think the reason there is such a day/night difference between PInvoke and JNI is that when MS released .Net, they knew it lacked a lot of functionality that Win32 provided, so they simply had to make this stuff work properly. Java doesn't sit on top of a legacy C API and therefore JNI is just an afterthought.