Calling C++ from Java using CNI ?

David Daney ddaney@avtrex.com
Mon Apr 28 16:00:00 GMT 2008


Gareth Buxton wrote:
> Hi,
> I have been trying to find out how to call C++ code from Java using
> CNI. Is this at all possible?
>> I found this page in the documentation which suggests a possible way:
>> http://gcc.gnu.org/onlinedocs/gcj/Interfaces.html#Interfaces
>> But I have been unable to make anything work using this. Are there
> any code examples?
>>libgcj is full of them. You could try looking in libjava (the source to 
libgcj) for files named nat*.cc
find . -name nat\*.cc
For example, you could look at java/io/File.java and 
java/io/natFilePosix.cc
I hope that helps.
David Daney


More information about the Java mailing list

AltStyle によって変換されたページ (->オリジナル) /