簡體   English   中英

無法在Eclipse中創建GWT Web應用程序項目

[英]Cannot create a GWT Web Application Project in Eclipse

在Eclipse中安裝GWT插件后,我遇到了一些問題,在這里已經談到了它們但是我沒有找到有關問題的有用幫助。

所以這里還有另一件事。 我可以選擇創建一個Web應用程序項目 因此,我創建了一個,並將其命名為“ Demo”,然后選中“使用Google Web Toolkit”,“使用默認SDK 2.6.0”,“使用Google App Engine”,默認1.9.17,然后單擊“完成”。

它為我生成了一個包含4個軟件包的項目,其中2個軟件包,“客戶端”和“服務器”帶有紅色圓圈,其中帶有x表示存在錯誤。 每個班級也都有。

當我單擊它們時,它說:

語法錯誤,僅當源級別為1.5或更高時,注釋才可用

它指示我進行更改。 我證明了這一點,在類和包之后,紅點消失了,但是項目目錄上仍然保留了一個紅點。

當我運行項目時,它將在控制台中顯示:

    Jan 19, 2015 2:09:23 AM com.google.appengine.tools.development.agent.AppEngineDevAgent premain
SEVERE: Unable to load the App Engine dev agent. Security restrictions will not be completely emulated.
java.lang.RuntimeException: Unexpected exception during cast.
    at com.google.apphosting.utils.clearcast.ClearCast$CasterImpl.cast(ClearCast.java:385)
    at com.google.apphosting.utils.clearcast.ClearCast.staticCast(ClearCast.java:252)
    at com.google.apphosting.utils.clearcast.ClearCast.staticCast(ClearCast.java:263)
    at com.google.appengine.tools.development.agent.AppEngineDevAgent.premain(AppEngineDevAgent.java:61)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at sun.instrument.InstrumentationImpl.loadClassAndStartAgent(Unknown Source)
    at sun.instrument.InstrumentationImpl.loadClassAndCallPremain(Unknown Source)
Caused by: java.lang.IllegalAccessException: Class com.google.apphosting.utils.clearcast.ClearCast$CasterImpl can not access a member of class com.google.appengine.tools.development.agent.$Proxy0 with modifiers "public"
    at sun.reflect.Reflection.ensureMemberAccess(Unknown Source)
    at java.lang.reflect.AccessibleObject.slowCheckMemberAccess(Unknown Source)
    at java.lang.reflect.AccessibleObject.checkAccess(Unknown Source)
    at java.lang.reflect.Constructor.newInstance(Unknown Source)
    at com.google.apphosting.utils.clearcast.ClearCast$CasterImpl.cast(ClearCast.java:383)
    ... 9 more

誰能幫我? 謝謝。

當我使用Java 1.8運行並將其更改為1.7時,出現此錯誤,此問題得以解決。

編輯:窗口->首選項-> Java->已安裝的JRE。 檢查jre7以使其默認。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM