Try these if you use maven. I use maven for my project and when I do mvn clean install
and try to run a program it throws the exception. So, I clean the project and run it again and it works for me.
I use eclipse IDE.
For Class Not Found Exception when running Junit test, try running mvn clean test
once. It will compile all the test classes.