Insert Java library in C

I am going to write a Java server / client application in which the client is not really a client (it does not have the main one), but it is a library.

In addition, I need to develop module C (fuse driver), which should interact with the server, so it needs to call the client function.

I founded many examples of C functions invoked by a Java application, but none of what I need.

Can you give me a suggestion or some tips?

EDIT

because someone could not understand what I needed, I want to be more clear: I have a server, and the program can interact with it only using a library written in Java. The real client is written in C, and it should be able to call library functions, so in C I need to call the java method

+5
source share
1 answer

There are two ways to link C and Java code; JNA and JNI.

JNA ; JVM C. JNA, Java- Java C, , . , (/): http://jna.java.net/javadoc/overview-summary.html#marshalling. , , , . , , C- Java- JNA.

Java JVM "" C, JNI.

, , , , Java < C C () , JVM. JVM C/++ JNI: fooobar.com/questions/322641/...

C JNI: JNI Eclipse

, (, , ) JNI C ++, RAII ..


Edit

JNI == . C, , .. JNI, , .

Java, JNIEnv ( , Java). Java (JNI) . , C, . , () Java- C, , , . , JNI, , .

+4

All Articles