I want to call an "interactive" Perl script from a Java program. Just for clarity, the other way around (from Perl to Java) is not suitable for me.
The script is interactive in the sense that it requires a small configuration dialog with the user. For example, a script call in cmd.exe will lead to a dialog, for example:
Do you want to overwrite the old settings? [yes, no (default = no)]
and the user must choose between spelling yes, no or nothing on the command line. And depending on the user's choice, another message will appear: "Do you want ....", and the user will respond, etc. Etc. I think you got the image.
My question is: how can I have the same dialog with the user when the script is called in a Java program? I mean, how can I capture script questions to the user, show them to the user, and then send the user's response (received in the Java program) to the script?
Simple Runtime.getRuntime (). exec () in this case does not work.
I hope that I have clearly stated the question.
Thank you for your help!
source share