2

i have a command line based program that i want to write a gui based wrapper for. is there a way that i can redirect the stdout steam from that program to my gui and launch the other program with arguments?

thank you

2 Answers 2

2

Yes. Invoke the program using Process and grab the input / output / error stream of the process.(see an example here: http://www.rgagnon.com/javadetails/java-0014.html)

I am having some problems with formatting, so here are some relevant links:

  1. How to create a process in Java
  2. Java Process with Input/Output Stream
Sign up to request clarification or add additional context in comments.

1 Comment

1

try Apache common-exec, it provides an api to invoke commands and capture the stderr, sdtout and provide an stdin.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.