Click to See Complete Forum and Search --> : Runtime Execute


Hellboyz
May 19th, 2010, 03:20 PM
Hello, I have a problem that I just can't figure out and to me makes absolutely no sense.


Runtime.getRuntime().exec("java -jar GiSE_Updater.jar");


The code above will not work on the main application. I've tried different variations of the same code but nothing. One day it just stopped working and no matter how hard I try it will not continue to work.

I've made test applications with only that line of code in it and they work flawlessly. I don't see how the same code can have two different effects when as far as I can see they are in the same exact situation.

I've checked my code many times and I've even set that line of code as the very first line of code in my application but yet it still will not work. It works in Netbeans but after I try using it outside of Netbeans it will not work. No errors no nothing. Just doesn't work.

Norm
May 19th, 2010, 03:41 PM
will not work

Are there any error messages? What about the error stream from the process?

One day it just stopped working
What changed between the day it worked and the day it didn't? Usually something must change for a computer to act differently.

Hellboyz
May 19th, 2010, 03:56 PM
*face palm* I swear I'm getting dumber everyday. The reason it wasn't running is because my updater is set to cancel everything if it can't delete the application it is supposed to be deleting because it's obvious that you can't really update an application if you can't overwrite it. Well when I fixed the updater I put the deleting/updating and the GUI on different threads so that they wouldn't interfere with each other and make the GUI freeze or what not.

I checked the output stream and seen what was wrong. The reason other applications could run the updater is because they were other applications and since they weren't the main application the updater could delete the main application. It all makes sense now.


Thank you Norm! I don't know when I would of ever thought to look through the output stream. I was planning to go with manual updates (which I really didn't want to do).