eclipse - 无法在 Eclipse 中导入 Appengine 模块

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

我该如何解决?谢谢!

最佳答案

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

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

https://stackoverflow.com/questions/8115415/

相关文章:

android - Android : How to tell where an error is

apache-flex - 将 Flex 从 3.2 升级到 4.5 - 错误和警告

compiler-errors - 用于MPLAB的示例USB项目上的编译错误

gcc - 交叉 mingw 编译因未知伪操作而失败

visual-studio-code - 如何更改 VS Code 设置以使用 JetBrains

iphone - iPhone openssl无法编译

gwt - Maven GWT插件 “failed with status 1”错误

compilation - 在 CentOS 6.0 上编译单声道时 undefined refer

visual-studio-2010 - 为Android编译C++项目时权限被拒绝

eclipse - Eclipse无法解决传递依赖项目?