【问题标题】:Cannot import Appengine modules in Eclipse无法在 Eclipse 中导入 Appengine 模块
【发布时间】:2011-11-13 22:51:31
【问题描述】:

在我的 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

我该如何解决?谢谢!

【问题讨论】:

    标签: eclipse google-app-engine gwt compiler-errors


    【解决方案1】:

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

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-06-25
      • 2021-12-29
      • 2020-06-06
      • 2019-12-15
      • 2014-08-09
      • 2020-07-02
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多