Where to find a CNI-Tutorial?

Jeff Sturm jsturm@one-point.com
Mon Aug 25 14:44:00 GMT 2003


On Mon, 25 Aug 2003, Clemens Eisserer wrote:
> 1.) Does anybody know good tutorials for CNI?
> The only tutorials I read where not really helpful, because they mostly
> coverd how to access java from c, not how to access c from java.

Native methods in CNI are C++, so they can call other C/C++ code.  If
you're accessing C code, the headers will have to be C++-safe.

Post an example if you're stuck.

> 2.) Is there a platform-independent way to store pointer-values in java
> variables using CNI. With JNI this isnt possible as far as I know,
> because storing pointer-values into "int" only works of cource on 32-bit
> machines.

That's what gnu.gcj.RawData is for.

Jeff



More information about the Java mailing list