我有一个外部 JAR signpost-core-1.2.1.1.jar(来自 http://code.google.com/p/oauth-signpost/ ),我想将其包含到我的 Java GWT 项目中。
因此,我将此外部 JAR 文件添加到 Eclipse 中的构建路径中,并将这些导入放入我的类中:
import oauth.signpost.basic.DefaultOAuthConsumer;
import oauth.signpost.exception.OAuthCommunicationException;
import oauth.signpost.exception.OAuthExpectationFailedException;
import oauth.signpost.exception.OAuthMessageSignerException;
编译时我收到以下错误消息:
[ERROR] Line 130: No source code is available for type oauth.signpost.basic.DefaultOAuthConsumer; did you forget to inherit a required module?
[ERROR] Line 133: No source code is available for type oauth.signpost.exception.OAuthMessageSignerException; did you forget to inherit a required module?
[ERROR] Line 135: No source code is available for type oauth.signpost.exception.OAuthExpectationFailedException; did you forget to inherit a required module?
[ERROR] Line 137: No source code is available for type oauth.signpost.exception.OAuthCommunicationException; did you forget to inherit a required module?
因此,我将以下行放入 Admin.gwt.xml 文件中:
<inherits name='oauth.signpost.Signpost' />
现在我收到此消息:
Loading inherited module 'oauth.signpost.Signpost'
[ERROR] Unable to find 'oauth/signpost/Signpost.gwt.xml' on your classpath; could be a typo, or maybe you forgot to include a classpath entry for source?
不幸的是,Signpost 不提供 gwt.xml 文件,因为它仅包含一个 jar 文件。
那我该怎么写呢?
我必须把它放在哪里?
或者我只需要设置一些额外的路径?
最佳答案
我不知道路标库,但我想您想在客户端使用它。不幸的是,oauth-signpost 仅适用于传统的 Web 服务。无论如何,如果您想使用它,只有在完全支持 jre 6 的服务器端才可能。在客户端,您只能使用仅使用模拟 gwt-jre 环境的提供的 gwt 模块。
关于java - 如何为外部 jar 创建 gwt.xml 文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3968854/