2013-11-27 66 views
3

我試圖用Guave 15.0與GWT 2.5.1,但它無法編譯。我使用編譯器參數-strict。在我的模塊我gwt.xml有:我添加GWT 2.5.1 Google Guava 15.0錯誤?

<inherits name="com.google.common.collect.Collect"/> 

我我的類路徑:

guava-15.0.jar 
guava-gwt-15.0.jar 

當我嘗試編譯我收到以下錯誤:

Compiling module test.Tttt 
    Validating units: 
     [ERROR] Errors in 'com/google/common/base/super/com/google/common/base/CharMatcher.java' 
     [ERROR] Line 760: SmallCharMatcher cannot be resolved 
    [ERROR] Aborting compile due to errors in some input files 

我用了空白gwt項目來演示這個錯誤。 The project can be found here.

編輯:

當我只包括此:

guava-gwt-15.0.jar 

我收到以下錯誤:

Validating units: 
     [ERROR] Errors in 'jar:file:/Users/mg/Documents/Grails/GGTS3.4.0-KEPLER4.3.1/mytest/lib/guava-gwt-15.0.jar!/com/google/common/base/super/com/google/common/base/CharMatcher.java' 
     [ERROR] Line 760: SmallCharMatcher cannot be resolved 

編輯:使用日誌級別的跟蹤編譯:

Public resources found in... 
    Unexpected entry in classpath; /System/Library/Java/Extensions/libAppleScriptEngine.jnilib is neither a directory nor an archive (.jar or .zip) 
    Unexpected entry in classpath; /System/Library/Java/Extensions/libJ3D.jnilib is neither a directory nor an archive (.jar or .zip) 
    Unexpected entry in classpath; /System/Library/Java/Extensions/libJ3DAudio.jnilib is neither a directory nor an archive (.jar or .zip) 
    Unexpected entry in classpath; /System/Library/Java/Extensions/libJ3DUtils.jnilib is neither a directory nor an archive (.jar or .zip) 
    Unexpected entry in classpath; /System/Library/Java/Extensions/libmlib_jai.jnilib is neither a directory nor an archive (.jar or .zip) 
    Unexpected entry in classpath; /System/Library/Java/Extensions/libQTJNative.jnilib is neither a directory nor an archive (.jar or .zip) 
    Unexpected entry in classpath; /usr/lib/java/libjdns_sd.jnilib is neither a directory nor an archive (.jar or .zip) 
Translatable source found in... 
Persistent unit cache dir set to: /Users/mg/Documents/Grails/GGTS3.4.0-KEPLER4.3.1/tttt/war/../gwt-unitCache 
Compiling module test.Tttt 
Looking for previously cached Compilation Units in /Users/mg/Documents/Grails/GGTS3.4.0-KEPLER4.3.1/tttt/war/../gwt-unitCache 
    Looking for precompiled archives. To disable, use -Dgwt.usearchives=false 
    Loading archived module: jar:file:/Applications/gwt/gwt-2.5.1/gwt-user.jar!/com/google/gwt/user/User.gwtar 
    Loading archived module: jar:file:/Applications/gwt/gwt-2.5.1/gwt-user.jar!/com/google/gwt/core/Core.gwtar 
    Loading archived module: jar:file:/Applications/gwt/gwt-2.5.1/gwt-user.jar!/com/google/gwt/regexp/RegExp.gwtar 
    Loading archived module: jar:file:/Applications/gwt/gwt-2.5.1/gwt-user.jar!/com/google/web/bindery/event/Event.gwtar 
    Found 2719 cached/archived units. Used 2719/3026 units from cache. 
    Compiling... 
     Compilation completed in 3,95 seconds 
    Added 3026 units to cache since last cleanup. 
    Validating units: 
     [ERROR] Errors in 'jar:file:/Users/mg/Documents/Grails/GGTS3.4.0-KEPLER4.3.1/tttt/lib/guava-gwt-15.0.jar!/com/google/common/base/super/com/google/common/base/CharMatcher.java' 
     [ERROR] Line 760: SmallCharMatcher cannot be resolved 
    Removing invalidated units 
Wrote 3026 units to persistent cache. 
    Resolving com.google.common.annotations.Beta 
     Found type 'com.google.common.annotations.Beta' 
     [WARN] Ignoring unresolvable annotation type com.google.common.annotations.GwtCompatible 
    Resolving com.google.common.annotations.GwtCompatible 
     Found type 'com.google.common.annotations.GwtCompatible' 
     [WARN] Ignoring unresolvable annotation type com.google.common.annotations.GwtCompatible 
    Resolving com.google.common.annotations.GwtIncompatible 
     Found type 'com.google.common.annotations.GwtIncompatible' 
     [WARN] Ignoring unresolvable annotation type com.google.common.annotations.GwtCompatible 
    Resolving com.google.common.annotations.VisibleForTesting 
     Found type 'com.google.common.annotations.VisibleForTesting' 
     [WARN] Ignoring unresolvable annotation type com.google.common.annotations.GwtCompatible 
    Resolving com.google.common.base.Absent 
     Found type 'com.google.common.base.Absent' 
     [WARN] Ignoring unresolvable annotation type com.google.common.annotations.GwtCompatible 
     Found type 'com.google.common.base.Optional' 
      [WARN] Ignoring unresolvable annotation type com.google.common.annotations.GwtCompatible 
      [WARN] Ignoring unresolvable annotation type com.google.common.annotations.Beta 
      Found type 'com.google.common.base.Supplier' 
         com.google.common.annotations.GwtCompatible 
    Resolving com.google.common.primitives.UnsignedInteger 
     Found type 'com.google.common.primitives.UnsignedInteger' 
     [WARN] Ignoring unresolvable annotation type com.google.common.annotations.GwtCompatible 
    Finding entry point classes 
    [ERROR] Aborting compile due to errors in some input files 
Shutting down PersistentUnitCache thread 
+0

CharMatcher是guava-15.0.jar的一部分。它不包含在guava-gwt-15.jar中。你做了什麼,你不能在客戶端使用CharMatcher。 –

+0

@ElHoss我更新了我的帖子,但只有guava-gwt仍然出現錯誤。任何想法? – confile

+0

將logLevel設置爲TRACE。這應該告訴我們更多關於錯誤的信息。 –

回答

0

Delet e gwt-unit文件夾。看起來你正在用舊版本的GWT生成你的項目。我可以證實,您的項目示例可以使用GWT 2.5.1進行編譯。