編譯或運行時出現Unable to find type ‘com.xxx.yyy.ClassName’ 怎麼處理

有時候的運行代碼時會出現如下錯誤:

Compiling module com.googlecode.gwt.charts.showcase.Showcase

   Finding entry point classes
      [ERROR] Unable to find type 'com.googlecode.gwt.charts.showcase.client.ShowCase'
         [ERROR] Hint: Check that the type name 'com.googlecode.gwt.charts.showcase.client.ShowCase' is really what you 
meant

         [ERROR] Hint: Check that your classpath includes all required source roots

其原因是,代碼需要調用com.googlecode.gwt.charts.showcase.client.ShowCase,但是它不在classpath環境內,只需把,src目錄加入classpath就可以執行了。

下面講個步奏最多的方法。

步奏一:在Package Explorer窗口選中項目名。按快捷鍵Alt+Enter或者點擊右鍵選擇下面的Properties


步奏二:選擇Run/Debug Settings,然後在右側雙擊項目,進入設置界面


步奏三:就進入設置選項卡了,這個界面應該很熟悉了。如下圖箭頭方向走。Classpath -> User Entries|項目名稱 -> Advanced(高級


步奏四:在彈出窗口選擇Add Folders(添加文件夾)


步奏五,選擇當前項目的src目錄,單擊確定,完成。


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章