From my experiences, just sophomore's , there are there possibilities to this problem as follows.
1.Lack of some dependencies.
2.Dependencies conflict
3.Haven't add jar packages to classPath
Solution to possibility 1####
In this case, your IDE may prompt you to import some packages, then you just do it as the tip shows.
Apart from this, you may set your IDE auto-import, the foundation could be easily found in you setting, or you can Google it.
Solution to possibility 2###
If not the above situation, then mostly could be this case, dependencies or jar packages conflict.
For this problem, check your pom.xml or use maven's command line(which i've forget hahaha, Google yourself) But if your IDE is IntelliJ IDEA, search dependency tree directly(Ctrl+Alt+Shift+U), which show you the confilct with a red line, just right click, then ** Exclude**. MyEclipse has similar foundatin too, but sorry for my barely-use of MyEclipse.
Solution to possibility 3####
Like i said, it could happend that you hadn't have added jar packages to classPath, then it may not be a problem, just do it, or Google .