GAE Deploying Java8 / Java7 bug
I am trying to deploy an essentially empty project to GAE via Intellij IDEA. I created a new project, set my project ID to appengine-web.xml, and left everything else as it is. I am getting the following error, with full log here .
java.lang.IllegalArgumentException: Class file is Java 8 but max supported is Java 7: org/eclipse/jetty/apache/jsp/JettyJasperInitializer$1.class in C:\Users\Tony\.m2\repository\com\google\appengine\appengine-java-sdk\1.9.48\appengine-java-sdk\appengine-java-sdk-1.9.48\jetty93\jetty-distribution\lib\apache-jsp\org.eclipse.jetty.apache-jsp-9.3.14.v20161028-nolog.jar
I tried to install JDK 7 installing everything to use this, used JDK 8 compiling in 1.7 and 1.8, nothing works.
source to share
I also ran the same error and solved it by downgrading the Google Appengine SDK from 1.9.48 to 1.9.46.
So with Intellij IDEA 2016.3.2 it works with Java 8 (sets environment variable IDEA_JDK_64 = jdk1.8.0_xx) and the Java project SDK is 1.7 and Google Cloud SDK using the GOOGLE_CLOUD_HOME = google-cloud-sdk- 138.0.0-windows-x86_64.
Now I can deploy to Google Cloud with "... Class file is Java 8, but maximum supported: Java 7: org / eclipse / jetty / apache / jsp / JettyJasperInitializer $ 1.class ..."
source to share
You only need to specify the java version that should be used to run the GAE application.
This can be done by modifying the file appengine-web.xml
in your GAE project. Check the tag <runtime>
from the example below:
<?xml version="1.0" encoding="utf-8"?>
<appengine-web-app xmlns="http://appengine.google.com/ns/1.0">
<application>your-app</application>
<version>1</version>
<threadsafe>true</threadsafe>
<runtime>java8</runtime>
</appengine-web-app>
source to share