GWT 2.5.1的Google Guava 15.0错误? [英] Google Guava 15.0 Error with GWT 2.5.1?
问题描述
我尝试在GWT 2.5.1上使用 Guave 15.0 ,但未能编译。我使用编译器参数-strict。在我的模块gwt.xml中,我有:
< inherits name =com.google.common.collect.Collect/ >
我添加了我的classpath:
guava-15.0.jar
guava-gwt-15.0.jar
当我尝试编译时,出现以下错误:
编译模块test.Tttt
验证单元:
[错误]错误在'com / google / common / base / super / com / google / common / base / CharMatcher.java'
[错误]第760行:SmallCharMatcher无法解析
[错误]由于某些输入文件中的错误而中止编译
我使用了空白的gwt项目来演示这个错误。 该项目可以在这里找到。
编辑:
当我只包含这个时:
guava-gwt-15.0.jar
我收到以下错误:
验证单元:
[错误]'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'
[错误] Line 760:SmallCharMatcher can not be已解决
编辑:使用日志级别跟踪编译:
在...中找到的公共资源
在classpath中出现意外的条目; /System/Library/Java/Extensions/libAppleScriptEngine.jnilib既不是目录也不是归档文件(.jar或.zip)
类路径中的意外条目; /System/Library/Java/Extensions/libJ3D.jnilib既不是目录也不是归档文件(.jar或.zip)
类路径中意外的条目; /System/Library/Java/Extensions/libJ3DAudio.jnilib既不是目录也不是归档文件(.jar或.zip)
类路径中意外的条目; /System/Library/Java/Extensions/libJ3DUtils.jnilib既不是目录也不是归档文件(.jar或.zip)
类路径中意外的条目; /System/Library/Java/Extensions/libmlib_jai.jnilib既不是目录也不是归档文件(.jar或.zip)
类路径中意外的条目; /System/Library/Java/Extensions/libQTJNative.jnilib既不是目录也不是归档(.jar或.zip)
类路径中的意外条目; /usr/lib/java/libjdns_sd.jnilib既不是目录也不是存档(.jar或.zip)
在...中找到的可转换源
持久单元高速缓存目录设置为:/ Users / mg /Documents/Grails/GGTS3.4.0-KEPLER4.3.1/tttt/war/../gwt-unitCache
编译模块test.Tttt
寻找以前缓存的编译单元/ Users / mg / Documents / Grails / GGTS3.4.0-KEPLER4.3.1 / tttt / war /../ gwt-unitCache
寻找预编译的归档文件。要禁用,请使用-Dgwt.usearchives = false
加载存档模块:jar:file:/Applications/gwt/gwt-2.5.1/gwt-user.jar!/ com / google / gwt / user / User。 gwtar
加载存档模块:jar:file:/Applications/gwt/gwt-2.5.1/gwt-user.jar!/com/google/gwt/core/Core.gwtar
加载存档模块: jar:file:/Applications/gwt/gwt-2.5.1/gwt-user.jar!/com/google/gwt/regexp/RegExp.gwtar
加载存档模块:jar:file:/ Applications / gwt / gwt-2.5.1 / gwt-user.jar!/com/google/web/bindery/event/Event.gwtar
找到了2719个缓存/存档单元。从缓存中使用2719/3026个单位。
正在编译...
编译完成时间为3,95秒
自上次清理以来,向缓存中添加了3026个单元。
验证单元:
[错误]'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'
[错误]第760行:SmallCharMatcher无法解析
删除无效单元
写入3026单位永久缓存。
解析com.google.common.annotations.Beta
找到类型'com.google.common.annotations.Beta'
[WARN]忽略无法解析的注释类型com.google.common.annotations。 GwtCompatible
解析com.google.common.annotations.GwtCompatible
找到类型'com.google.common.annotations.GwtCompatible'
[WARN]忽略无法解析的注释类型com.google.common.annotations .GwtCompatible
解析com.google.common.annotations.GwtIncompatible
找到类型'com.google.common.annotations.GwtIncompatible'
[WARN]忽略无法解析的注释类型com.google.common。 annotations.GwtCompatible
解析com.google.common.annotations.VisibleForTesting
找到类型'com.google.common.annotations.VisibleForTesting'
[WARN]忽略无法解析的注释类型com.google.common .annotations.GwtCompatible
解析com.google.common.base.Absent
找到类型'com.google.common.base.Absent'
[WARN]忽略无法解析的注释类型com.google.common.annotations.GwtCompatible
找到类型'com.google.common.base.Optional'
[WARN]忽略无法解析的注释类型com.google.common.annotations.GwtCompatible
[WARN]忽略无法解析的注释类型com.google.common.annotations.Beta
找到类型'com.google .common.base.Supplier'
com.google.common.annotations.GwtCompatible
解析com.google.common.primitives.UnsignedInteger
找到类型'com.google.common.primitives.UnsignedInteger '
[WARN]忽略无法解析的注释类型com.google.common.annotations.GwtCompatible
查找入口点类
[错误]由于某些输入文件中的错误而中止编译
关闭down PersistentUnitCache线程
删除gwt-unit文件夹。看起来你正在用旧版本的GWT生成你的项目。我可以证实,您的项目示例可以使用GWT 2.5.1进行编译。
I tried to use Guave 15.0 with GWT 2.5.1 but it fails to compile. I use the compiler parameter -strict. In my module gwt.xml I have:
<inherits name="com.google.common.collect.Collect"/>
I my classpath I added:
guava-15.0.jar
guava-gwt-15.0.jar
When I try to compile I get the following error:
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
I used a blank gwt project to demonstrate this error. The project can be found here.
Edit:
When I only include this:
guava-gwt-15.0.jar
I get the following error:
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
Edit: Compiled with log level trace:
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
Delete the gwt-unit folder. It looks like your are generating your project with an older version of GWT. I can confirm, that your project example can be compiled with GWT 2.5.1.
这篇关于GWT 2.5.1的Google Guava 15.0错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!