I would like to call a c++ program from java application, packaged in a jar file. Is it possible to package and call c++ from the jar file? Thanks
1 Answer
Calling C++ functions from Java, you need read about JNI.
The exported C++ functions will store in dynamic libraries such as .dll(Windows) or .so(Linux) files.
Then try to package that .dll file into the jar file (Read this).
2 Comments
Jon7
Actually, you can package so's and dll's in JARs and Java can even load them with JNI! Here's some info on it stackoverflow.com/questions/11578903/…
kem
The C++ program is command line app with input + args and the generated output will be parsed by a java class. I want to deploy the c++ program packaged in a jar file with the java app.