2

I'm trying to develop a project using Android Studio which includes an App Engine component.

  • App Engine only supports compiling with Java 7 (will not allow me to deploy the app if compiled with Java 8: "Class file is Java 8 but max supported is Java 7").
  • The latest versions of Android Studio only support JDK 8 (will not let me select a Java 7 JDK in project options: "Please choose JDK 8 or newer").

The best workaround I can find is to specify options to compile with Java 7 compatibility via Gradle config files:

sourceCompatibility = JavaVersion.VERSION_1_7
targetCompatibility = JavaVersion.VERSION_1_7

This allows me to develop using Android Studio, using JDK 8, and deploy to App Engine. However, when I run the Jetty-based local/dev server, I run into the issue mentioned here: The type java.lang.CharSequence cannot be resolved in package declaration.

It seems like targeting Java 7 using the Java 8 JDK may not be sufficient, and I will need to use a real v7 JDK in order to get around this issue?

Any solutions?

Community
  • 1
  • 1
CAW
  • 369
  • 1
  • 8

0 Answers0