1. 程式人生 > >Eclipse錯誤:Problems opening an editor Reason: [Project Name] does not exist解決辦法

Eclipse錯誤:Problems opening an editor Reason: [Project Name] does not exist解決辦法

問題簡單描述:在eclipse裡用F3想進入某個類的某方法時,提示以下錯誤:

Problems opening an editor Reason: [專案名] does not exist


經過百度上谷歌一番,看到stackoverflow上的相同的一個問題 的解決方法如下:


 
本人英語不是太好,不做完整的字句翻譯(後面有英文),只能簡單用中文說一下問題的原因:我的專案是從github clone下來的,可能是在匯入eclipse時,專案還不是“通常”的eclipse專案,所以有些功能還不能使用,比如[我想看引用到的類或方法]這個功能就還不能用,解決的辦法就是先轉一下專案。而我clone的原始碼裡面有pom.xml,就是可以使用maven構建專案啦,所以我就轉成maven專案。

轉換的第一種方式:

專案右鍵-->configure-->convert to maven project   #這個方法沒能解決我的問題,且編譯錯誤
轉換的第二種方式:

cd到專案根目錄-->mvn eclipse:eclipse   #這個解決了我的問題
 

解決問題總結:

直接使用maven的命令轉到eclipse專案即可。
 

下面的內容雖然沒有能直接解決問題,至少給瞭解決問題的方向,引用部分內容:

 If you have checked out project from svn, project checked out is not generally a eclipse project thats why general functionality of eclipse does not work for the same.

To achieve the same functionality of eclipse like eclipse reader and all other shortcuts,we have to convert the checked out project to eclipse project.

Steps to Convert checked out project to eclipse project:

    Right Click on Checked-out Project.
    Point to Configure.
    Click on Convert to Maven Project.(if checked out project is maven project)

These steps will convert the project to Maven project.

All the eclipse functionality will work for the same.
So I have resolved the issue by checking out the project via "New Project Wizard". Embarrassed
It wasn't an Eclipse project in SVN, so when checked out via "Existing Project", none of the project functionality could work.