If ve tried this program on eclipse and it worked fine. Every Line is written on the new File, including exit. I can't find the error.