0

Hello friends.
I am currently involved in a project where we want to export data from mysql to xls, for this we have written a program that is in *jar format.
What we want to do is execute this file through php after which we will send it to the user.
We have to code to send to the user but need a functional method to execute the jar file.

P.S Time consumption has little or no priority D.S

//K0ns3rv

Edited by K0ns3rv: n/a

4
Contributors
4
Replies
14
Views
7 Years
Discussion Span
Last Post by Atli
1

Hey.

If you can execute your JAR file via a command line, you could use the exec function to execute it and capture the output.

For example:

<?php
exec('java -jar /pat/to/file.jar', $output);
print_r($output);
?>

Which would print every line of output generated by the JAR file.

0

The above does the job but silently, do you know how to run a jar file so that it does everything that the jar file suppose to do (i.e. open up another browser... and rest of the instructions)? (not in the background though)

0

PHP executes on the server. If you want Java code to be executed on the client, you need to execute it on the client. PHP can't help you with that. Look into Java applets if you want this done through the browser. - However, applets understandibly have strict security restrictions. You may need to create a normal Java client app for full functionality.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.