在project explorer中找到当前项目: 右键项目->Build Path->Configure Build Path… 如图,勾选maven Dependencies,再Apply即可 new选项中出现class