C ++ client for Java RMI? Or any other way to use Java from C ++?

We need to use the Java library from C ++ code. The idea that I had was that if we could build a C ++ client for Java RMI (ideally using some kind of environment or wizard), we could run Java lib as a separate server. This seems cleaner than trying to start a Java VM in a C ++ application.

Alternatively, if you have any other idea on how to use Java from C ++, I would be happy to hear. We are working on Linux.

Many thanks,

David

+3
source share
3 answers

JNI was designed to solve the problem of integrating C / C ++ into Java. It's not hard.

, .

CORBA RMI .

. Java ++, JNI.

JVM Java ++ (JDK doc)

+1

RMI JVM ( Java), . ++ JVM.

CORBA - . , . WS-/JAX-WS - XML, CORBA. REST WS-, . Joel Stackoverflow DevDay "".

TCP/IP ( ). , , exec ++. : JNI JRE, JNA - .

+3

Do not worry about RMI. If you are ready to take the Java application step as a separate server, contact your C ++ client through JMS (Java Messaging Service). ActiveMQ is a free implementation of the JMS message broker that provides built-in services as well as C ++ client libraries . The JMS protocol is easy to use (at least with Java). It is probably not as flexible as REST, but most likely it will be easier.

+2
source

Source: https://habr.com/ru/post/1725655/


All Articles