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
Post a Comment