java - Calling a .jar file using laravel Framework for PHP -


i have run .jar using json file argument , return json, use methods:

exec("java -jar /grupa3/ip.jar /grupa3/input.json"); 

and method try using shell

shel_exec("java -jar /grupa3/ip.jar /grupa3/input.json"); 

but going wrong. please me.

i solve problem run .jar file have problem need execute jar argument , it's don't work. code of running jar without argument , it's work:

<button id="execbtn" type="button"  onclick="executejar()" class="btn btn-primary btn-lg">executa</button> 

function in js:

var executejar = function () {  $.ajax({     method: "get",     url: "http://localhost:81/back-end/laravel/public/modul2",     data: {execjar: "true"} }).done(function(){  }); 

}

and php code:

<?php if (isset($_get['execjar'])){         chdir('c:\wamp\www\back-end\laravel\public\grupa2');         exec('java -jar modul2.jar');     } ?> 

i use same comand argument:

exec('java -jar modul3.jar input.json'); 

and comand don't work


Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -