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?
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?
Do you have Java code of what is in your jar file or just classes?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
> is it possible use PHP associate with above java command to accomplish that?
Yes, use
system('<command>', $retval);
Yes, use
system('<command>', $retval);
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.
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.
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.
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
>>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 ;)
Only if the java app has been written correctly. Exit codes often aren't by Java programmers - you might be lucky ;)
ASKER
I have got the problem, PHP code cannot capture file path, I am thinking another way to accomplish that!
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thanks CEHJ,
Can you explain more specific of your instruction? I am not java expert!
Can you explain more specific of your instruction? I am not java expert!
ASKER
Since no further comments, I only partially complete the solution.