无法在 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
如何解决?谢谢!
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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您无法从 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.