开发者

Change the default output folder for a java command when executed by php

I am trying to run a java command like this in a PHP Joomla Component. It works, however, the files generated from the command are written to /administrator and I want them to be written to the location where the Java command resides ie. /administrator/com_mycomponent/java/MyJavaApp.jar

            //run the command
            $javaCommand = "$javaCommand -jar $keyGeneratorFile $appName";
            $response = exec($javaCommand);

            if(empty($response)) {
                JError::raiseError(500, "Key Generation failed for command: $javaCommand");
            }

What can I do? Is there some sort of option I can use with the 开发者_如何学Pythonjava command?


If you can change the java program you can use the solutions discussed in following question:

Get location from where the Java code is executed


You could create a script that first changes to the directory you want and then runs the command. Then call exec on that script.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜