Quote:
Originally Posted by Gudy
WaitAMinute. Wait. Just. A. Minute.
Did I understand that right? You're using a GUI written in Java to call another program, also written in Java, and you're calling "jave.exe -jar" directly by either Runtime.getRuntime().exec() or ProcessBuilder()?! That strikes me as, sorry for the language, bass ackwards.
Why not just directly call the main() method of the main class from the LRFTools jar with the arguments as a string array instead? It's nice, clean, simple, and most of all, platform independent. If you don't want to wait for the program to return, use a separate thread to run the LRFTools from the GUI...
|
Yep, this is better than spawnning a new process. You can call lrf.RecurseDirs.main(String args[]), args holding the command-line parameters on a fresh thread to do the work.
Also, if you want to see progress, before calling to the above static method; you can assign to System.out and System.err two new PrintStreams, and then periodically show their contents to a frame on your GUI.
Thanks to all,
Eladio