27

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?

4

13 Answers 13

14

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.
11

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

10
+500

[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

5
  • 2
    Here's a fairly recent post of a Google employee which confirms that Java 8 is coming to GAE: groups.google.com/d/msg/google-appengine/8y80sEhr7Rc/… Aug 4, 2015 at 12:38
  • @JensBannmann Still not supported as it seems because I am still getting that "Unsupported .. version.." exception .. May 27, 2016 at 21:24
  • @displayname look into Flex. I really think this will be the way to go to be able to run Java8. You can control whichever runtime you want with them :).
    – Patrice
    May 27, 2016 at 21:47
  • your question is popular and everyone looking for the problem related to google app engine and java 8 may confuse due to accepted answer. @Ian has answer which have the solution of problem. Nov 11, 2016 at 6:51
  • 1
    Google App Engine Java 8 support is generally available as of Q3 2017. cloud.google.com/appengine/docs/standard/java/runtime-java8
    – Dagang Wei
    Sep 26, 2017 at 16:57
10

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.

3
  • How to map Docker Container with GAE Managed VMS??
    – Bharathi
    Apr 12, 2016 at 7:12
  • Hey user7610. Just noticed a small error in your answer: the trial ks actually 60 days. Not 3 months.
    – Patrice
    May 27, 2016 at 22:18
  • Updated, thanks. Either I made a mistake in the first place, or the terms changed.
    – user7610
    Jul 19, 2016 at 8:50
4

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.

4

Google App Engine Java 8 support is generally available as of Q3 2017. https://cloud.google.com/appengine/docs/standard/java/runtime-java8

2

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.

2

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

2

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

Thanks

1

Add <runtime>java8</runtime> to your appengine-web.xml file.

0

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

0

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
-2

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/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.