I have a script(install.sh) which builds a linux application from source it has commands ./configure make and make install..
I want to run that script from java..
I have used Process proc = Runtime.getRuntime().exec("./install.sh"); proc.waitFor();
When i run ./install.sh on shell it continuously gives a large output like processing.. compiling.. etc.. etc.. and the application gets installed
But when i run it using my java prog then the java program waits for a long time and the application does not gets installed..
Is there any solution to the above problem...
Can i run large scripts that take say minutes to complete using java?
Thanks in advance..
The code which i used was as follows: Here i am passing the cmd array to this function
I have made a GUI using swing so on a button click the code gets executed!
I have a textarea i want to dynamically add the contents of the buffer to it i.e. the way the contents gets printed on the console it should get appended in the textarea! I am new to swing...
I tried myTextArea.append(line+"\n"); instead of System.out.println(line); but the content gets added after the execution is complete it does not get added dynamically!
Any help will be appreciated thanks in advance...
Thanks for your 1st 2 suggestions i'l keep that in mind.
but this also appends the entire contents of the buffer when the command gets executed.
I am running a script which takes minutes to run, i wanted the text area to display the contents dynamically so that i can check what is going in the script execution process. I wanted the contents to get printed in the text area the way it gets printed on the console when i use and using read the cursor does not get set at the end so i used setCaretPosition using that it worked! Please help me out...