Run Java class file from PHP script on a website -


I have a website and want to be able to allow the user to run a Java file from the server on the web.

I want users to click on a button that will run the Java file on the server and printed to the standard outlet by the Java program, the user will be printed on the website to see.

How can this be done (call the Java program from PHP and insert the standard file back in PHP from the Java file in real time)?

Update:

Thanks for answering the way to run Java programs though I also want to be able, because the Java program is printed on stdout , Where it will print a lot of text as it is executed, to be able to print it on this webpage so that the user can see which stage the Java program is in its execution.

How can this be done and any additional AJAX or JavaScript required or something like this?

PHP exec () function is the way to go, but whatever It is permitted to execute it must be very be careful . In other words do not rely on user input because it can potentially compromise your entire server.

Calling Java Application Launcher using AGL, you can execute any Java application with PHP, e.g.

  & lt ;? Php exec ("java -jar file.jar argument", $ output); ? & Gt;  

Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -