1

I am writing an interface to a DB backend. This needs to work with C++ and C#. The java code will use third party libraries that have similar libraries in C++ and C#.

First off, how would I get the java code to be executed in C++ or C#? I know Java has JNI to be able to make C++ calls. Is there a way to do it in reverse?

How do I include the c# and C++ libraries from the third party java library?

Instinct
  • 2,201
  • 1
  • 31
  • 45
  • 2
    Why are you mixing all these languages? Each, on it's own, can interface to a DB. – Anon Mail Dec 04 '15 at 07:11
  • BTW, there also seems to be an answer for C#: http://stackoverflow.com/questions/4103979/how-to-embed-java-into-c-sharp – Andreas Fester Dec 04 '15 at 07:27
  • Interesting C++ technique. Do you know if there are any significant performance issues with spawning JVM in C++? – Instinct Dec 04 '15 at 07:28
  • @Instinct Java itself does it the same way (`java.exe` also loads the `jvm.dll`, looks up the main method in the class passed as argument and passes control to the java engine). If you have specific performance requirements, you need to do a prototype and measure memory and time consumption anyway... – Andreas Fester Dec 04 '15 at 07:31

0 Answers0