How to call an executable jar from php with an argument passed to main method

后端 未结 1 2094
我在风中等你
我在风中等你 2020-12-11 08:35

I have created an executable jar and it works fine. For the testing purpose, I have used a dummy variable in the main method.

Instead, I need to pass a string variab

相关标签:
1条回答
  • 2020-12-11 09:10
    shell_exec("java -jar your_JAR.jar arg1 arg2");
    

    you can also execute Java at all by using exec instead of shell_execute, giving it $output and & $return_var variables (see the linked manual page) and seeing what they contain after the call.

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