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

c# - SelectList with Dictionary, add values to the Dictionary after it's assigned to SelectList -

how can i manage url using .htaccess in php? -

ios - I get the error Property '...' not found on object of type '...' -