无法在 Eclipse 中导入 Appengine 模块

发布于 2024-12-15 10:23:56 字数 467 浏览 2 评论 0原文

在我的 Eclipse 项目 (GWT) 中,我尝试导入下面的模块,以便添加一些 Blobstore 代码。

import com.google.appengine.api.files.FileService;
import com.google.appengine.api.files.FileServiceFactory;

我没有从 Eclipse 构建功能中收到任何错误或警告。然而,当我从 Eclipse 执行“GWT 编译”时,我收到以下错误消息:

[ERROR] Line 3: The import com.google.appengine.api.files cannot be resolved
[ERROR] Line 4: The import com.google.appengine.api.files cannot be resolved

如何解决?谢谢!

In my Eclipse project (GWT) I am trying to import the modules below, in order to add some Blobstore code.

import com.google.appengine.api.files.FileService;
import com.google.appengine.api.files.FileServiceFactory;

I don't get any error or warning from the Eclipse build function. Nevertheless, when I do "GWT compile" from Eclipse, I get the error messages below:

[ERROR] Line 3: The import com.google.appengine.api.files cannot be resolved
[ERROR] Line 4: The import com.google.appengine.api.files cannot be resolved

How can I sort it out? Thanks!

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

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

发布评论

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

评论(1

战皆罪 2024-12-22 10:23:56

您无法从 GWT 客户端引用非客户端代码。请记住,您的 GWT 客户端代码将被编译为 Javascript,因此无法编译出对实际 Java 的任何引用。

确保对 blobstore api 的任何引用都是在服务器代码中完成的,而不是在客户端中完成的。在必须可编译为 JavaScript 的代码中,这些导入绝对不是必需的。

You cannot reference non-client code from your GWT client. Remember that your GWT client code will be compiled to Javascript, so any references to actual Java can't be compiled out.

Make sure any reference to the blobstore api is done in server code, not client. Those imports should never be necessary in code that must be compilable to javascript.

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