简体   繁体   English

Google App Engine和Java版本?

[英]Google App Engine and Java Version?

I have jre 7 installed and jdk 6u29. 我安装了jre 7和jdk 6u29。 I can't install jre6 because an old version of it is stopping the install, I've tried removing all traces of it but it still telling me an old version is installed. 我无法安装jre6,因为它的旧版本正在停止安装,我已经尝试删除它的所有痕迹,但它仍然告诉我安装了旧版本。

My question is can I develop for GoogleApp engine with jdk6 and jre7 combination? 我的问题是我可以使用jdk6和jre7组合为GoogleApp引擎开发吗? I keep getting error in my logs that indicate the class was compiled with the wrong version java? 我的日志中一直出现错误,表明该类是使用错误的java版本编译的?

Well, on GAE's page it doesn't say anything specific about JDk7, but I think that's just because the page hasn't been updated in a while. 好吧,在GAE的页面上,它没有说明JDk7的任何具体内容,但我认为这只是因为该页面暂时没有更新。 I can tell you that i do infact use JDK 7 with GAE (have done so for months) and everything's fine. 我可以告诉你,我确实使用JDK 7和GAE(已经这样做了几个月),一切都很好。

Normally the JRE doesn't enter in this equation, as running the GAE locally will still make use of the same JDK you use for dev. 通常,JRE不会输入此等式,因为在本地运行GAE仍将使用您用于dev的相同JDK。 However if you indeed would manually try to run a JDK7 compiled class using JRE6 this would not work, but again, I don't think this is an issue in your context. 但是,如果您确实手动尝试使用JRE6运行JDK7编译的类,这将无效,但同样,我不认为这是您的上下文中的问题。

you can change your compiler version in eclipse using following steps 您可以使用以下步骤在eclipse中更改编译器版本

  1. Right click on project and take properties 右键单击项目并获取属性
  2. Change java compiler to the desired version 将java编译器更改为所需的版本

Make sure Your 确保你的

  • java Build Path (right click on you project > properties > Java Build Path > Libraries ) java Build Path (右键单击项目>属性> Java构建路径>库)
  • Java compiler (right click on you project > Properties > Java Compiler ) Java compiler (右键单击你的项目> Properties> Java Compiler)

are point to same java version. 是指向相同的java版本。

The easiest way to make it same is change the Project Facets 最简单的方法是改变Project Facets

right click on you project > properties > Java (select the correct java version)

如果你的类是用旧版本的Java编译的(这里我的意思是JDK)你可以在新的java VM上运行这些类(这里我的意思是JRE),所以,你可以回答,但这是一些奇怪的情况......

如果您使用Android Studio(1.3)开发Google AppEngine应用程序,请不要使用Oracle的JDK 1.8作为Java工具,您应该使用JDK 1.7。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM