Reputation: 49
I have poker bot written in C++. I want to compete it with another Poker Academy agent. In order to do that there is an API in JAVA namely "meerkat api".
I have no idea how to call my c++ executable from java api, how does one go about communicating with the independent c++ executable from within a java package?
Upvotes: 1
Views: 1050
Reputation: 12837
Or if you need to integrate with the C++ app on lower lvl meaning not only "run a program and process the results". You can use the JNI or easier variant JNA, but I have to admit it is pain.
Upvotes: 1
Reputation: 16158
After reading/following @hmjd, Well you can use DefaultExecutor from Apache Commons Exec library to execute commands but it internally uses java.lang.Runtime
and java.lang.Process
.
I would suggest you to use this library over Runtime because Apache Command Execution APIs are more sophisticated, and provide all and more features than Java Runtime. It also handles exit Values.
Upvotes: 0