Reputation: 324
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?
Upvotes: 27
Views: 12514
Reputation: 28811
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.
Upvotes: 10
Reputation: 4692
[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
Upvotes: 10
Reputation: 8178
Java 8 is now generally available on App Engine Standard Environment, joining the GA runtime on the App Engine Flexible Environment.
The new Java 8 runtime has all the benefits of Java 7 but with upgrades and enhancements:
Upvotes: 14
Reputation: 26488
Google App Engine Java 8 support is generally available as of Q3 2017. https://cloud.google.com/appengine/docs/standard/java/runtime-java8
Upvotes: 4
Reputation: 196
App Engine Standard Java now supports Java8. See the Beta documentation at: Java8 on GAE Standard documentation
Thanks
Upvotes: 2
Reputation: 31
yes it does. We just launched this to Beta and soon GA.
https://cloudplatform.googleblog.com/2017/06/Google-App-Engine-standard-now-supports-Java-8.html
Upvotes: 2
Reputation: 1331
You can apparently use JDK8 to create JRE7 compatible byte code, and this seems to be what Google recommends: https://cloud.google.com/appengine/docs/standard/java/download
-source 1.7 -target 1.7
Upvotes: 0
Reputation: 1141
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/
Upvotes: -2
Reputation: 31
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
Upvotes: 0
Reputation: 7558
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.
Upvotes: 2
Reputation: 4850
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.
Upvotes: 4
Reputation: 27697
Not at the time of writing but you can keep track of the status in this issue:
Upvotes: 11