Using a pre-made C++ library in Java using JNI

320 views Asked by At

I'm trying to create a version of RakNet for Java. I've heard about how JNI can execute C++ code. So from what I understand I need to have two libraries. One is RakNet itself, the other is a bridge written with JNI that calls the appropriate method from RakNet. But due to the large size of RakNet, it would take all month to create the bridge from Java to RakNet.

Is there a way to do what I've explained more efficiently? I don't even know if I'm doing this correctly.

1

There are 1 answers

1
Severin On

You can look at JNA (Java Native Access). In JNA there is no need to write a bridge libarary.