May 11
JNI is often scoffed at for being insanely difficult.
JNA aims to make it easier for you to access native code, and I heard about it from Romain (they used it in their Swing makeover talk to do cool windows).
I have heard of a mythical group at Sun who created a simple way to load a DLL/SO and allow you to go right after it. Some at Sun didn’t like the idea as it would be so easy, that some users may go native too often.
I need to look closer at it, but in theory it looks really good.
May 11th, 2007 at 7:27 am
I don’t know of any mythical group at Sun, but the JNA project was posted last fall with some long dormant code which was a tweak of a JavaONE 1999 presentation. It doesn’t look to me that Sun “suppressed” something more substantial over all that time.
Since February the project has been improved to actually be usable in real-world scenarios (see the rabbit hole link for some examples, including the shaped/transparent windows, which are also included in the JNA examples).
May 11th, 2007 at 11:13 pm
Java definitely needs something along the lines of PInvoke in .NET to make it simple to access native APIs. But obviously such code should be subject to security restrictions and should not be easily invoked. I bet it leads lot of rich applications in Java with media capabilities and ability to build a lot of system tools.
May 18th, 2008 at 11:42 pm
not familiar with java stuff,still learning