Question: why eclipse is closing automatically?
Answer: Memory Setting. This is also one of the main reason for this problem. Sometimes when you run a memory intensive application in Eclipse and Eclipse run out of memory then you can get this issue. To increase the memory open the eclipse.