Google Docs Java API 的构建问题

发布于 2024-10-17 22:52:49 字数 1173 浏览 2 评论 0原文

我正在尝试使用一些谷歌文档功能,我决定学习他们提供​​的基本教程 这里

我按照他们的指示进行操作,但在尝试运行时出现以下错误:

Exception in thread "main" java.lang.NoClassDefFoundError: com/google/common/collect/Maps
    at com.google.gdata.wireformats.AltRegistry.<init>(AltRegistry.java:118)
    at com.google.gdata.wireformats.AltRegistry.<init>(AltRegistry.java:100)
    at com.google.gdata.client.Service.<clinit>(Service.java:555)
    at technical.services.getDocumentList.main(getDocumentList.java:15)
Caused by: java.lang.ClassNotFoundException: com.google.common.collect.Maps
    at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
    ... 4 more

我仔细检查了我的构建路径中是否具有所需的所有依赖项,我知道它们在我的项目中得到了认可,因为当我从引用的 API 实例化对象时,IDE 不会抱怨。

任何帮助将不胜感激。

I'm trying to get some google docs functionality going and I've decided to do the basic tutorial they provide here

I followed their instructions to the T but got the following error when I tried to run:

Exception in thread "main" java.lang.NoClassDefFoundError: com/google/common/collect/Maps
    at com.google.gdata.wireformats.AltRegistry.<init>(AltRegistry.java:118)
    at com.google.gdata.wireformats.AltRegistry.<init>(AltRegistry.java:100)
    at com.google.gdata.client.Service.<clinit>(Service.java:555)
    at technical.services.getDocumentList.main(getDocumentList.java:15)
Caused by: java.lang.ClassNotFoundException: com.google.common.collect.Maps
    at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
    ... 4 more

I double checked that I had all of the dependencies that were required in my build path, and I know they are recognized in my project because the IDE isn't complaining when I instantiate objects from the referenced API's.

Any help would be appreciated.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

旧故 2024-10-24 22:52:49

我缺少以下 Jar,这显然是需要的,但在教程中没有提到。

deps/google-collect-1.0-rc1.jar

I was missing the following Jar which is apparently needed but not mentioned in the tutorial.

deps/google-collect-1.0-rc1.jar
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文