Skip to content

Restore Java 8 source/target compatibility for MobiVM consumers#294

Merged
keesvandieren merged 3 commits into
masterfrom
copilot/set-target-compatibility-to-8
Jun 6, 2026
Merged

Restore Java 8 source/target compatibility for MobiVM consumers#294
keesvandieren merged 3 commits into
masterfrom
copilot/set-target-compatibility-to-8

Conversation

Copilot AI commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

gdx-pay had moved its Java compilation target to 11, which breaks libGDX iOS/MobiVM projects that still require Java 8-compatible bytecode. This change brings the build back in line with the rest of the libGDX ecosystem by targeting Java 8 for both source and output.

  • Build compatibility

    • Lower Java compilation settings from 11 to 8 in the shared Gradle JavaCompile configuration.
    • Apply the same Java 8 source/target settings in modules that were still hard-coding Java 11.
  • Published artifact behavior

    • Set options.release = 8 when building on Java 9+ for non-Android Java compilation, so published Java artifacts are compiled against Java 8 APIs as well as emitted as Java 8 bytecode.
    • Skip options.release for Android library projects, because Android Gradle Plugin requires Java 8 builds to use only sourceCompatibility and targetCompatibility.
  • Scope

    • Updates only the Gradle build configuration for affected Java modules:
      • core
      • client
      • server
      • Android Amazon
      • iOS RoboVM Apple
tasks.withType(JavaCompile).configureEach {
    sourceCompatibility = JavaVersion.VERSION_1_8
    targetCompatibility = JavaVersion.VERSION_1_8
    if (JavaVersion.current().isJava9Compatible() && !project.plugins.hasPlugin('com.android.library')) {
        options.release.set(8)
    }
}

Copilot AI changed the title [WIP] Set source and target compatibility to Java 8 for gdx-pay Restore Java 8 source/target compatibility for MobiVM consumers Jun 4, 2026
Copilot AI requested a review from keesvandieren June 4, 2026 17:36
@keesvandieren

Copy link
Copy Markdown
Member

@copilot compilation is failing, please fix the problems

Copilot AI commented Jun 6, 2026

Copy link
Copy Markdown
Contributor Author

@copilot compilation is failing, please fix the problems

Fixed in dc68bfd. The CI failure was caused by applying --release 8 to Android compilation; the shared Gradle config now keeps Java 8 source/target compatibility but skips options.release for Android library projects.

@keesvandieren keesvandieren marked this pull request as ready for review June 6, 2026 05:31
@keesvandieren

Copy link
Copy Markdown
Member

@obigu we've restored compatibility to 8. Still building with Java 17 as that is what we're currently using in our libgdx projects, and JDK 8 is a problem on Apple Silicon.

@keesvandieren keesvandieren merged commit 6cdedfa into master Jun 6, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TargetCompatibility 11 is not compatible with MobiVM

2 participants