简体   繁体   中英

Does Google App Engine support Java 8?

Trying to get started with Google App Engine - does it work with Java 8?

I've followed the instructions on this page: https://console.developers.google.com/start/appengine

Selecting 'Java', I successfully completed the Maven build, but when I visit localhost:8080 nothing is running.

The instructions say "make sure you have Java 7 JDK installed" however I have just installed Java 8 JDK.

Do I need to separately install Apache?

Java 8 is now generally available on App Engine Standard Environment , joining the GA runtime on the App Engine Flexible Environment.

Learn about the differences .

The new Java 8 runtime has all the benefits of Java 7 but with upgrades and enhancements:

  • OpenJDK 8-based Java runtime supports the standard public Java library (no whitelist)
  • Doesn't impose a security manager--your code won't be restricted by Java permissions issues.

Not at the time of writing but you can keep track of the status in this issue:

[The passage of time has changed the 'no' from this accepted answer to 'yes'. Please see others answers below.]

Short answer, no. They will integrate it over time, but for now if you use it, it will cause you a lot of errors. I would recommend against it

Also take note of user7610's answer below :). It is as of now the only way to have Java 8 on the Cloud Platform

Update: it is available in the "standard" (sandboxed) offering since mid 2017, https://cloud.google.com/blog/products/gcp/java-8-on-app-engine-standard-environment-is-now-generally-available

Before then, it was sort-of available, via Managed VMs. The idea is that you provide a Docker container with whatever software you need (like Java 8) and GAE will use that as your app instance VMs. You still get the autoscaling, monitoring and all that.

The disadvantage of Managed VMSs is that you are charged as for the Compute Engine VMs. That means you pay by minute and there is no free quota. There is the $300 credit for new user accounts for 60 days, but after that you'd have to pay.

If your interest is in using lambda expressions on Google App Engine, you could give Retrolambda a try. I haven't tried it yet, but it claims to backport Java 8 lambda expressions to Java 7.

Google App Engine Java 8 支持从 2017 年第 3 季度开始全面提供。https://cloud.google.com/appengine/docs/standard/java/runtime-java8

App Engine Standard Java now supports Java8. See the Beta documentation at: Java8 on GAE Standard documentation

Thanks

It's not quite the same thing, but you can use Java 8 with the new App Engine " flexible environment ". I don't think you can access App Engine APIs (such as the images service or task queues) but you'll be able to use services which live outside of App Engine, such as the Datastore and Pub/Sub.

It's also worth bearing in mind that the service is currently in beta (so not covered by any SLAs). Also, the pricing is different ; instead of using the normal App Engine pricing structure, it's based on usage of GCE virtual machines.

<runtime>java8</runtime>到您的 appengine-web.xml 文件。

Yes, using App Engine flexible environment. Here are the official docs: https://cloud.google.com/appengine/docs/flexible/java/

And here is the github repo for this implementation: https://github.com/GoogleCloudPlatform/appengine-java-vm-runtime

您显然可以使用 JDK8 来创建 JRE7 兼容的字节码,这似乎是 Google 推荐的: https ://cloud.google.com/appengine/docs/standard/java/download

-source 1.7 -target 1.7

Yes, You can use flexible environment. and change setting of your app.yaml

vm: true

for more information study https://cloud.google.com/appengine/docs/flexible/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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