I am trying to launch an external fortran executable from Java. To launch from the command line I would type "programName (space) path to input dataset" and this would bring up the already loaded (with data) application. I am able to launch a standard executable (without the input file name) using ProcessBuilder but if I try to include the input file name it does bring up the application until I quit the java program that executed the ProcessBuilder call.
I thought of trying ProcessBuilder.Redirect.from to input the data file name but I do not understand how to use this class and I do not have an example.
I'm only guessing now, since you didn't provide the source code. Common mistake when running external processes from Java is the failure to consume standard output and error stream of the external process. Your issue might belong to the same class. Please read this (somewhat lenghty) article, it should help you to execute an external program flawlessly.
If this does not help, post the relevant code here. We'll try to have a look at it.
Thank you for your reply. I have indeed read that article and a few others beside and I am aware of the need for maybe taking care of possible output from the executed program.
The following code snippet is from my program and is what happens as a result of a button press in the main program:
If I leave the StreamGobbler calls in then the program never advances past that point. If I remove these lines (as shown) then the program does start up the "executable" but does not display it untill I exit the main program.
Goodbye moon men. Hello tiny ad:
a bit of art, as a gift, the permaculture playing cards