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?

Patrice
  • 4,641
  • 9
  • 33
  • 43
512damon
  • 324
  • 1
  • 3
  • 6
  • It now support Java8 (in BETA) https://cloud.google.com/appengine/docs/standard/java/runtime-java8 – yegle Jun 28 '17 at 16:57
  • Please see my answer below for the state of play as of today. You might like to change the accepted answer! – crb Jun 28 '17 at 17:10
  • 1
    The accepted answer should get updated. Java 8 is available on all flavors of App Engine now. – BrettJ Sep 13 '17 at 22:16
  • 1
    Google App Engine Java 8 support is GA now. https://cloud.google.com/appengine/docs/standard/java/runtime-java8 – Dagang Oct 03 '17 at 15:51

13 Answers13

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.
crb
  • 8,132
  • 6
  • 37
  • 48
11

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

Andrejs
  • 26,885
  • 12
  • 107
  • 96
10

[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

crb
  • 8,132
  • 6
  • 37
  • 48
Patrice
  • 4,641
  • 9
  • 33
  • 43
  • 2
    Here's a fairly recent post of a Google employee which confirms that Java 8 is coming to GAE: https://groups.google.com/d/msg/google-appengine/8y80sEhr7Rc/66WnFoBvL3AJ – Jens Bannmann Aug 04 '15 at 12:38
  • @JensBannmann Still not supported as it seems because I am still getting that "Unsupported .. version.." exception .. – Stefan Falk May 27 '16 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 '16 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. – dhyanandra singh Nov 11 '16 at 06:51
  • 1
    Google App Engine Java 8 support is generally available as of Q3 2017. https://cloud.google.com/appengine/docs/standard/java/runtime-java8 – Dagang Sep 26 '17 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.

user7610
  • 25,267
  • 15
  • 124
  • 150
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.

Stijn Van Bael
  • 4,830
  • 2
  • 32
  • 38
4

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

Dagang
  • 24,586
  • 26
  • 88
  • 133
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.

Ian
  • 7,480
  • 2
  • 47
  • 51
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

Community
  • 1
  • 1
Ludo
  • 196
  • 2
1

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

Alien
  • 444
  • 2
  • 9
  • 28
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
Raven
  • 1,264
  • 1
  • 12
  • 22
-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/

dhyanandra singh
  • 1,071
  • 2
  • 18
  • 38