I am developing a dynamic web project (RESTful jersey) under Eclipse IDE.
Under src/my/demo/service folder I have CarService.java class
public class CarService {
...
}
Under src/my/demo/controller folder I have UserController.java class
import my.demo.service.CarService;
public class UserController{
private CarService carService; //ERROR: CarServcie cannot be resolved to a type
}
I do have imported the CarService, why eclipse give me the error "CarServcie cannot be resolved to a type" in my UserController.java?
--------Edit------------------
I found the cause: for some reason, my.demo.service has the same level as src/ in eclise project explorer view. After I move my.demo.service under src/, it is fine. Seems I should not create new package in "Project Explorer" view in Eclipse.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…