2014年3月2日 星期日

java Could not find class

下載了 photon server 的 android client 範例,編釋上沒什麼問題,只是執行後會出現如下錯誤:
Could not find class 'de.exitgames.demo.loadbalancing.ClientDemo', referenced from method de.exitgame.demo.loadbalancing.ApplicationManager.<client>

也出現了這種錯誤,後頭訊息就不打出來了
java.lang.NoClassDefFoundError:
本來以為沒什麼,google後一狗票的解決方法,試了一整天,竟解決不了,都快放棄了。最後試了在專案放jar庫的地方,也就是libs上
按右鍵->build path->use as source folder,選擇後就解決了。

但最吐血的還不在這,原本想好好做個記錄,讓有碰到相同問題的朋友們不要像我一樣浪費整天的時間,於是把專案砍掉,重新滙入,準備把錯誤
詳細記下,結果好像從來沒發生過似的,這個問題消失了,也不用按右鍵去選 use as source folder ,真是令人無言。