Executing external program in java and passing commands

后端 未结 2 1976
陌清茗
陌清茗 2021-01-16 12:04

I have this chess engine Rybka.exe, that i have to execute in java Here is an example how you run Rybka: Once you clicked on it, console opens and waits for input. So then y

相关标签:
2条回答
  • 2021-01-16 12:32

    a) how to bind a windows console application with java application?

    link provided by the courtesy of Google search query:

    https://www.google.pl/search?q=java+binding+console+to+an+app&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a

    b) in short:

     InputStream is = p1.getInputStream();
     OutputStream os = p1.getOutputStream();
    

    (supplied by the obvious http://docs.oracle.com/javase/1.4.2/docs/api/java/lang/Process.html)

    0 讨论(0)
  • 2021-01-16 12:42

    Have you tried passing parameters/commands as below?

    Runtime.getRuntime().exec("Rybka.exe parameter1,parameter2");

    0 讨论(0)
提交回复
热议问题