Execute .jar file from PHP through command prompt

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rajkskumar
    New Member
    • Jul 2010
    • 1

    Execute .jar file from PHP through command prompt

    Hi, I have a .jar file which has a command line interface. I want to call the jar file through command prompt and capture the output of the Jar file.

    I have tried with the exec() command.

    The command I have used is:
    Code:
    exec('java -jar D:\Development\Filehandler\dist\Filehandler.jar getConfigLang', $result);
    Should something else be done before executing this command? like adding path etc???

    Please help me...
  • dlite922
    Recognized Expert Top Contributor
    • Dec 2007
    • 1586

    #2
    It doesn't work?

    You shouldn't need anything else unless your jar program needs something.

    What do you get when you run that command manually?

    Dan

    Comment

    Working...