为什么 exec('java -jar file.jar') 在浏览器上不起作用
我快要疯了。
几个小时,尝试相同但不起作用我有以下代码:
<?php
exec('java -jar /home/user/classname.jar --some arguments',$output,$result);
如果我从命令行运行,则可以工作,但如果您进入我的服务器并且我尝试运行则不起作用,我已尝试使用其他命令并工作完美地作为“java -version”,ls,mkdir,chmod,cp,date等
I am about to go insane.
for hours, trying the same and does not work I have the following code:
<?php
exec('java -jar /home/user/classname.jar --some arguments',$output,$result);
works if I run from the command line, but if you get on my server and I try to run just does not work, I have tried with other command and work perfectly as "java -version", ls, mkdir, chmod, cp, date, etc
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
问题在于操作系统的架构。 jar 是在 Windows 7 64Bits with 1.6_26 32-bit 中编译的,服务器具有 Linux x86_64。我再次编译 .jar 文件并且工作正常。
“编写一次,随处运行。” ...当然
the problem is the architecture of the OS, the. jar was compiled in Windows 7 64Bits with 1.6_26 32-bit and the server has Linux x86_64. i compile again .jar files and work fine.
"write once, run anywhere." ...of course