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 variable, while calling this executable jar from php.
In short, I need to:
How can I accomplish the aforesaid?
shell_exec("java -jar your_JAR.jar arg1 arg2");
您还可以通过使用exec而不是shell_execute
来执行 Java,为它提供$output
和 & $return_var
变量(请参阅链接的手册页)并在调用后查看它们包含的内容。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.