Re: JNI in Java 1.6

  • From: Andreas Stefik <stefika@xxxxxxxxx>
  • To: programmingblind@xxxxxxxxxxxxx
  • Date: Sat, 1 Jan 2011 09:39:48 -0600

I should add one more thing. Technically, while the JNI documentation
says you should use JavaH, this step is not required, it just
generates the H files for you. In our code, we usually just write out
the functions by hand, copying the previously generated ones and
changing the names/types slightly. Admittedly, that's much easier to
do when you are doing maintenance releases and have a good handle on
how JNI works, not getting started, but it's useful.

Stefik

On Sat, Jan 1, 2011 at 9:36 AM, Andreas Stefik <stefika@xxxxxxxxx> wrote:
> Hi John,
>
> QuentinC is correct. I would add one more thing, in that JNI has been
> in the JDK for a very long time, and to my knowledge there should not
> be any significant difference (if any) between 1.5 and 1.6 in relation
> to it.
>
> My team, for example, has used a ton of JNI code both on 1.5 platforms
> and 1.6, with no changes.
>
> Stefik
>
> On Sat, Jan 1, 2011 at 4:20 AM, QuentinC <quentinc@xxxxxxxxxxx> wrote:
>> Hello,
>> Try javah with only the full class name. It should generate an header called
>> something like java_package_subpackage_classname.h.
>> Note, I would rather advise JNA for most projects, except if the binding has
>> to be very quick. IN JNA you don't have to write any C/C++ binding code, the
>> DLL is directly loaded.
>>
>>
>> __________
>> View the list's information and change your settings at
>> //www.freelists.org/list/programmingblind
>>
>>
>
__________
View the list's information and change your settings at 
//www.freelists.org/list/programmingblind

Other related posts: