Shox88
Shox88

Reputation: 67

Google app engine deployment error: Class file is Java 8 but max supported is Java 7

I am using IntelliJ and following this tutorial to Deploy an example hello world App. When following the steps to deploy the app I get the following error:

java.lang.IllegalArgumentException: Class file is Java 8 but max supported is Java 7 org/eclipse/jetty/apache/jsp/JuliLog.class in /Users/appengine-java-sdk-1.9.50/jetty93/jetty-distribution/lib/apache-jsp/org.eclipse.jetty.apache-jsp-9.3.16.v20170120-nolog.jar

Unable to update app: Class file is Java 8 but max supported is Java 7: org/eclipse/jetty/apache/jsp/JuliLog.class in /Users/appengine-java-sdk-1.9.50/jetty93/jetty-distribution/lib/apache-jsp/org.eclipse.jetty.apache-jsp-9.3.16.v20170120-nolog.jar

I am using java version 1.7.0_71 in the project structure. My compiler settings are set to generate 1.7 compatible bytecode: screenshot of IDE compiler settings

Anyone have any ideas as to how this can be fixed?

EDIT Fixed the web.xml version was the problem see here

Upvotes: 4

Views: 2635

Answers (3)

Philip Murray
Philip Murray

Reputation: 56

If you are using <appengine-web-xml> tag rather than <web-xml> tag, adding <runtime>java8</runtime> solved this issue for me (I am using the gradle appengine plugin version 2.0.6).

<?xml version="1.0" encoding="utf-8"?>
<appengine-web-app xmlns="http://appengine.google.com/ns/1.0">
  <application>my_app_id</application>
  <version>1</version>
  <runtime>java8</runtime>
  <threadsafe>true</threadsafe>
</appengine-web-app>

Upvotes: 4

Shox88
Shox88

Reputation: 67

This solved it Changed the web.xml file to:

    <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         version="2.5"
  xmlns="http://java.sun.com/xml/ns/javaee"
         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">

Thank you.

Upvotes: 0

CrazyCoder
CrazyCoder

Reputation: 401887

According to this report, the problem is caused by web.xml version.

So the problem is that the web.xml uses version 3.1, while App Engine Standard only supports 2.5 which causes the staging to fail with this error message. Please change the version and try deploying again.

Similar problem was also reported here.

you're seeing an open bug we have right now with the App Engine SDK where a misleading error message is provided when you use a Java 7 app with a web.xml configured to servlet 3.1 (which doesn't support Java 7).

Upvotes: 0

Related Questions