In my case issue occurred because of missing library. So below are the steps to make it work
1) Right click your project, Build Path --> Configure Build Path --> Java Build Path --> Libraries
2) Remove the missing libraries
3) Go to your main class and run it