运行本地GAE应用程序的问题:未解决的编译问题



我把我的项目目录移到了另一台计算机上,然后我遇到了这个问题:

HTTP ERROR 500
Problem accessing /index.jsp. Reason:
    java.lang.Error: Unresolved compilation problems: 
    The method find(Class, long) in the type Objectify is not applicable for the arguments (Class, Long)
    Type mismatch: cannot convert from Object to Usuario
    The method delete(Class, long) in the type Objectify is not applicable for the arguments (Class, Long)
    Syntax error, parameterized types are only available if source level is 1.5
    Syntax error, parameterized types are only available if source level is 1.5
    Syntax error, parameterized types are only available if source level is 1.5
    Syntax error, parameterized types are only available if source level is 1.5
  • 我的Objectify JAR已经设置在构建路径中
  • 作为JRE库,我使用JDK 1.7.0_02
  • 作为我的APP ENGINE SDK,我使用的是1.6.1.1

我已经遵循了很多指南来解决类似的问题,比如卸载和重新安装我所有的JRE/JDK,但都没有成功。我不知道该怎么办了。希望有人能帮我解决这个问题,谢谢!

您提到了JRE,但Eclipse也有"编译器合规级别"。它可能被设置为1.4或其他什么吗?

另一种可能性是,您的项目使用的是非标准JRE,尽管默认为1.7。

这个错误说明了一切:您试图用Long类的实例调用find方法,而该方法需要一个Long。GAE使用的java似乎不提供自动装箱,因此您必须使用java.lang.Long类的longValue()来自己执行装箱。

最新更新