Gradle project in eclipse builds fine but java files show compilation error
Removing the project from workspace and importing it again as a gradle project fixed the issue for me. Maybe somewhere down the path I have done something that has removed the "gradle" nature of the project.
Right click on your Project-> Goto Gradle-> Refresh Gradle Project
. Eclipse would pick the jars downloaded by gradle now.