Skip to content

API-34: Support targeting JDK 17 #8304

Description

@MihaMarkic

Android application type

Classic Xamarin.Android (MonoAndroid12.0, etc.)

Affected platform version

VS 2022 17.x

Description

I'm trying to create a binding library for an .aar library that targets JDK 17

kotlin {
      jvmToolchain(17)
  }

I'm getting this error: javac.exe error JAVAC0000: class file has wrong version 61.0, should be 55.0

And there seems no way to use (Open)JDK 17 as VS build really really wants to use 11 even if 17 is installed as well.
Is there any way to use JDK 17? Hopefully official support is planned soon.

Steps to Reproduce

  1. Create a binding library for emarsys:core-api:3.6.0 but I guess any similar library targeting JDK 17 will do.
  2. When compiling client for library created in step above, javac.exe compiler will produce errors mentioned in description.

Did you find any workaround?

Use an older version of the library that targets JDK 11.

Relevant log output

No response

Activity

  1. jpobst commented on Aug 28, 2023

    @jpobst
    Contributor

    Thanks for bringing this to our attention. The first version of Android that supports JDK 17 will be Android 14, which is still in beta.

    We made a list of the things we need to do in order to get support for JDK 17 into .NET 8 / API-34 this morning. We are hoping to get that support into .NET 8 RC 2.

    Note that if you are still using Classic Xamarin.Android, API-34 will not be supported there, so it likely will not be receiving JDK 17 support.

  2. changed the title [-]Can't create .aar binding library that targets JDK 17[/-] [+]API-34: Support targeting JDK 17[/+] on Aug 28, 2023
  3. added
    Area: App+Library BuildIssues when building Library projects or Application projects.
    and removed
    needs-triageIssues that need to be assigned.
    on Aug 28, 2023
  4. added this to the .NET 8 milestone on Aug 28, 2023
  5. jonpryor commented on Aug 28, 2023

    @jonpryor
    Contributor

    We will also need to update $(LatestSupportedJavaVersion) to 17.99.0 as part of JDK-17 support.

  6. added a commit that references this issue on Aug 29, 2023
  7. MihaMarkic commented on Aug 29, 2023

    @MihaMarkic
    Author

    Thanks for clarification, guys. I guess this issue can be closed?

  8. jpobst commented on Aug 29, 2023

    @jpobst
    Contributor

    We're going to use this issue as our reference for adding JDK 17 support for API-34. 😁

  9. jpobst commented on Oct 2, 2023

    @jpobst
    Contributor

    This should be completed for the upcoming releases:

    • Classic XA 13.2.2
    • .NET 7 7.0.402 (?)
    • .NET 8 RC2
  10. locked and limited conversation to collaborators on Jan 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Area: App+Library BuildIssues when building Library projects or Application projects.

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions