1

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?

2
  • I'd suggest you create a process but I somehow think it's more complicated than that. You'll need to write an adapter of sorts to control the C++ program, presumably via stdin. Commented Aug 27, 2012 at 15:13
  • 1
    This is a question-answer site. You should ask a question, not just post a status update on your current sentiments. Commented Aug 27, 2012 at 15:17

3 Answers 3

4

To get started see:

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

Comments

1

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.

Comments

0

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.

Comments

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.