How can compile and run java programme in php? -


this question has answer here:

this java file.

hello.java

class hello {    public static void main(string args[])    {       system.out.println("hello");    } } 

i want compile , run file in php. php file.

index.php.

<?php     exec('java'.hello.java, $output);     if ($resultcode)     {        echo "result: " . $resultcode . "\n";       //echo implode("\n", $output);     } ?> 

create jar file source , php, run exec() command , run command:

java -jar myjar.jar 

Comments

Popular posts from this blog

javascript - Count length of each class -

What design pattern is this code in Javascript? -

hadoop - Restrict secondarynamenode to be installed and run on any other node in the cluster -