@ImageAnalyst, I believe you completely misunderstand me. My executable program does not crush, it works as it supposed to be. It creates some java objects (in which there is also a frame) and when it completes the job terminates itself. Whereas if there is a figure in the program it waits user to close the window.. The main task here is to ensure that program waits the user to terminate it when compiled without a figure!