2

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 1

2

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).

Sign up to request clarification or add additional context in comments.

2 Comments

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/…
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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.