When you exit in the Java GUI program
System.exit (0);
Try to write, so if the system captures if there is a non-0 error