An oldie but goodie. This article shows you how to implement it properly: When Runtime.exec() won't - JavaWorld