Boost logo

Boost :

Subject: Re: [boost] Library proposal: Boost.JniTools - The easy way to call Java methods from C++ (build on top of JNI)
From: Jarrad Waterloo (jwaterloo_at_[hidden])
Date: 2011-02-09 08:27:47


On 2/9/2011 5:22 AM, Boris Brodski wrote:
> Hello everyone,
>
>
> I'm the maintainer of the 7-Zip-JBinding project:
> - On SourceForge: http://sevenzipjbind.sourceforge.net/
> - On GitHub: https://github.com/borisbrodski/sevenzipjbinding/tree/RW (Check
> the RW branch)
>
> In order to call C++ code from Java and vice versa the JNI (Java Native
> Interface)
> should be used. This interface is low level and provides little safety. (Java VM
> crashes very easy)
> Also to get a good performance, a bunch of code is always needed to cache ids
> and some pointers
> returned from jni.
>
> In the new version of 7-Zip-JBinding (see git RW branch) I wrote a library, that
> solves some of JNI problems. It uses simple DSL (defines) to describe java
> classes/interfaces
> with their methods/fields. It generates from the DSL during pre-compile time
> some kind of
> easy to use skeletons around Java classes and interfaces, providing very simple
> access
> to their methods and fields.
>
> Here are the features:
> - Type-safe calls from C++ to Java - The compiler will check the number and type
> of
> all passed arguments to the called methods. The same applies to setting field.
> - Caching of method ids and class pointers.
> - Auto-determining java method signature from the DSL.
> - Consistent JNI low level error handling
> - Tools to debug checking and cleaning exceptions after each method call.
> - Code completion of the java methods and fields from C++ with IDE,
> capable of expanding defines (for example, with Eclipse CDT).
>
> ...
>
>
> In case, this library has a real chance to become a part of the Boost library,
> I would be happy to remove all the7-Zip-JBinding dependencies,
> implement missing features and discuss other possible improvements.
> It would be match better, if someone will volunteer to help me on this and
> share the responsibility.
>
>
> Regards,
> Boris Brodski

How does this compare with the http://jnipp.sourceforge.net/ project?


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk