在eclipse中新建了一個maven專案搭建Spring原始碼閱讀環境,建立一個bean生產getter和setter方法的時候報錯“the resource is not on the build path of a java project”

這種情況是因為在工程中找不到類;

解決辦法:專案右鍵buildpath,然後將src下的檔案都remove掉之後,重新add進來,然後關閉開啟就可以了。