Skip to main content
GameDev.net gamedev.net
🔒 Locked 🎮 Unity

Problem with Java ProcessBuilder

Started by Metzler Nov 29, 2006 at 6:43 PM 1 replies 3.7k views
Original Post
Metzler
Metzler
Hi there, This one is not game related and has nothing to do with C/C++ etc. ;) I am currently trying to start an RCP application out of another rcp application via ProcessBuilder.start(). The problem is: If do not read the InputStream of the process, the RCP application starts up, but really slowly and with a strange behaviour (i.e. it does start up after some minimizing and maximizing the starting application). If i do read the inputstream of the application, it start up, but immediately after startup hangs... This is the current code. With this "version" it starts but hangs up...

ProcessBuilder builder = new ProcessBuilder(executable, argument);
			builder.directory(new File(path));
			Process p = builder.start();
			Scanner s = new Scanner(p.getInputStream()).useDelimiter("\\Z");	
			while (s.hasNext()) s.next();
Thanks for answers!
Metzler
Metzler
Thanks, that helped :)
The hint at the end of this article about reading out both inputstreams asynchronously did it... :)

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.