Link to home
Start Free TrialLog in
Avatar of liyy
liyy

asked on

enable java command scripting on GUI for end-user use

Hi,

I have following java command as below, we want to enable it to GUI for end-user use, my boss didn't want user running command line, is there any ways to do that?

java -jar xxxxxx.jar compare ${1} ${2} output-file.doc

Ideally, user can input file1 and file2 on the interface and then run above java command.

Server and client platform are Mac OSX server and Mac computer receptivity.

Apart from java environment, is it possible use PHP associate with above java command to accomplish that?
Avatar of for_yan
for_yan
Flag of United States of America image

Do you have Java code of what is in your jar file or just classes?
ASKER CERTIFIED SOLUTION
Avatar of for_yan
for_yan
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
> is it possible use PHP associate with above java command to accomplish that?
Yes, use
system('<command>', $retval);
Avatar of liyy
liyy

ASKER

thanks for yan,

I only know how to write PHP, Java is out of my hands, of course, use webpage add some text box and input filename from user and then execute java command line, something like that.
Avatar of liyy

ASKER

wesly,

I also need to write PHP to handle error in case end-user didn't input the filename, wrong file name, wrong path, etc, let me try to use your suggestion.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of liyy

ASKER

Write PHP is easy for me, but I have no experience for the PHP code associate with Java comand, if java have run-time error, can PHP can handle this! Let me try, I don't mind to post the code if the program run successful!
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of CEHJ
>>But the exit code/reval should be the same as "nonzero" if failed.

Only if the java app has been written correctly. Exit codes often aren't by Java programmers - you might be lucky ;)
Avatar of liyy

ASKER

I have got the problem, PHP code cannot capture file path, I am thinking another way to accomplish that!
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of liyy

ASKER

thanks CEHJ,

Can you explain more specific of your instruction? I am not java expert!
Avatar of liyy

ASKER

Since no further comments, I only partially complete the solution.