我很难让GWT与Guava合作。我将guava-r09-gwt.jar
添加到了我的类路径,并将<inherits name="com.google.common.collect.Collect"/>
(从this question复制)添加到了我的*.gwt.xml
文件中。但是,我仍然收到以下错误:
[错误]第99行:没有源代码 可用于类型 com.google.gwt.thirdparty.guava.common.collect.Lists; 你忘了继承一个必需的 模块?
引用的行是:
List<String> suggs = Lists.newArrayList();
如果我尝试以下inherits
标记:
<inherits name="com.google.common.collect.Lists"/>
然后GWT完全失败 - 在浏览器中访问应用程序会产生404,并且Eclipse的开发面板中不会显示任何URL。
我做错了什么?
答案 0 :(得分:8)
您会注意到com.google.gwt.thirdparty.guava.common.collect.Lists
实际上并不在番石榴罐中。请尝试引用com.google.common.collect.Lists
,您应该取得更多成功。
答案 1 :(得分:0)
Buddy我有同样的问题(并在StackOverflow上询问),请查看in this thread。希望有所帮助!正如Collin指出的那样,你导入错误,不要使用第三副库。