If yes, check the path which you use to call the class.
For example, if your program looks like this:
public class abc
Then you should use:
instead of just:
This is the problem I once met, hope it makes some sense for you.