2013-10-09 192 views
1

我遵循libgdx項目設置,當我將項目導入eclipse時,出現這些錯誤,並且沒有任何運氣可以搜索修復程序。將libgdx項目導入eclipse時出錯

The type java.lang.Object cannot be resolved. It is indirectly referenced from required     .class files MainActivity.java /Spellcast-android/src/en/fred/spellcast line 1 Java Problem 
The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files RobovmLauncher.java /Spellcast-robovm/src/en/fred/spellcast line 1 Java Problem 
The project was not built since its build path is incomplete. Cannot find the class file for java.lang.Object. Fix the build path then try building this project Spellcast-robovm  Unknown Java Problem 
The type com.google.gwt.core.client.EntryPoint cannot be resolved. It is indirectly referenced from required .class files GwtLauncher.java /Spellcast-html/src/en/fred/spellcast/client line 8 Java Problem 
The project was not built since its build path is incomplete. Cannot find the class file for com.google.gwt.core.client.EntryPoint. Fix the build path then try building this project Spellcast-html  Unknown Java Problem 
The project was not built since its build path is incomplete. Cannot find the class file for java.lang.Object. Fix the build path then try building this project Spellcast-android  Unknown Java Problem 

有誰知道我錯過了什麼?

回答

7

試試這些,希望他們會幫助。

右鍵單擊該項目並轉到屬性。在屬性窗口中:

  • 選擇Android和確保一個 版本的Android的檢查(我已經導入項目建立之前的版本的Android,我還沒有下載的 開發工具 因爲,所以他們不會編譯,直到我做到這一點)。
  • 選擇Java Build Path,然後選擇Order and Export選項卡。確保 一切都被檢查。
  • 選擇Java Compiler並確保您的 正在使用Java 1.6進行編譯。
+1

我覺得自己像個盲人仙人掌,但當你說「確保Android的版本被選中」時,我不太明白你指的是什麼。哦,還有我爲什麼要用Java 1.6進行編譯? – Troubleshoot

+2

如果您在屬性窗口中選擇Android選項,則右側會出現一個框,用於選擇要編譯的Android SDK的版本。有可能沒有選擇它們,這會阻止項目編譯。至於Java 1.6,我相信這是LibGDX寫入的級別。請參閱本頁頂部的註釋:https://github.com/libgdx/libgdx/wiki/Manual-project-setup – Tenfour04

+0

不是真的,它適用於Android,不適用於libgdx。 Android不支持java 1.7 – Lestat