-
Notifications
You must be signed in to change notification settings - Fork 64
[build] Add support for JDK 17 #1141
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Update `<JdkInfo/>` task to emit new `$(Java*MajorVersion)`
and `$(JavaApi*DefineConstants)` MSBuild properties. These are used
by `src/Java.Base` so that it knows which JDK version it's binding.
Update `src/Java.Base` to support binding the `java.base.jmod` from
JDK 17.
Note: This "JDK-17 Java.Base binding" was a "time limited" effort.
To build against JDK-17:
1. Install JDK-17.
2. Prepare and override `$(JdksRoot)`:
dotnet build -t:Prepare Java.Interop.sln -p:JdksRoot=/Library/Java/JavaVirtualMachines/microsoft-17.jdk/Contents/Home
will use the Microsoft OpenJDK 17 installation on macOS.
3. Build:
dotnet build Java.Interop.sln
jonpryor
added a commit
to jonpryor/xamarin-android
that referenced
this pull request
Aug 29, 2023
Context: dotnet#8304 Context: dotnet#8029 Context: https://web.archive.org/web/20230507035529/https://developer.android.com/studio/releases/#jdk-17 > Starting from Android Studio Flamingo Canary 3, the Studio IDE is > bundled with JDK 17. Context: dotnet/java-interop#1141 > Does It Build™? Because of dotnet#8029 we know we *can* use JDK 17. Because of dotnet#8304 we know we *should* use JDK 17. Update `xaprepare` so that Microsoft OpenJDK 17.0.8 is provisioned for the build. Note: `$(_JavacSourceVersion)` and `$(_JavacTargetVersion)` are *not* changed, so that our built `.jar` tooling can still *run* on JDK-11. Update to use Gradle 8.1.1. This is needed for JDK-17 support. Update `$(LatestSupportedJavaVersion)` to 17.0.99 so that JDK 17 can be used by .NET Android projects by default.
jpobst
approved these changes
Aug 29, 2023
jonpryor
added a commit
to jonpryor/xamarin-android
that referenced
this pull request
Aug 31, 2023
Context: dotnet#8304 Context: dotnet#8029 Context: https://web.archive.org/web/20230507035529/https://developer.android.com/studio/releases/#jdk-17 > Starting from Android Studio Flamingo Canary 3, the Studio IDE is > bundled with JDK 17. Context: dotnet/java-interop#1141 > Does It Build™? Because of dotnet#8029 we know we *can* use JDK 17. Because of dotnet#8304 we know we *should* use JDK 17. Update `xaprepare` so that Microsoft OpenJDK 17.0.8 is provisioned for the build. Note: `$(_JavacSourceVersion)` and `$(_JavacTargetVersion)` are *not* changed, so that our built `.jar` tooling can still *run* on JDK-11. Update to use Gradle 8.1.1. This is needed for JDK-17 support. Update `$(LatestSupportedJavaVersion)` to 17.0.99 so that JDK 17 can be used by .NET Android projects by default.
jonpryor
added a commit
to jonpryor/xamarin-android
that referenced
this pull request
Sep 1, 2023
Changes: dotnet/java-interop@5adb4d4...5bb0d24 * dotnet/java-interop@5bb0d24b: [build] Add support for JDK 17 (dotnet/java-interop#1141) * dotnet/java-interop@7e3bd2f2: Revert "[build] Enable NuGet's Central Package Management (dotnet/java-interop#1114)" (dotnet/java-interop#1138) * dotnet/java-interop@7961b360: [build] set `$(DisableTransitiveFrameworkReferenceDownloads)`=true (dotnet/java-interop#1137) Context: dotnet#8304 Context: dotnet#8029 Context: https://web.archive.org/web/20230507035529/https://developer.android.com/studio/releases/#jdk-17 > Starting from Android Studio Flamingo Canary 3, the Studio IDE is > bundled with JDK 17. Because of dotnet#8029 we know we *can* use JDK 17. Because of dotnet#8304 we know we *should* use JDK 17. Update `xaprepare` so that Microsoft OpenJDK 17.0.8 is provisioned for the build. Note: `$(_JavacSourceVersion)` and `$(_JavacTargetVersion)` are *not* changed, so that our built `.jar` tooling can still *run* on JDK-11. Update to use Gradle 8.1.1. This is needed for JDK-17 support. Update `$(LatestSupportedJavaVersion)` to 17.0.99 so that JDK 17 can be used by .NET Android projects by default.
jonpryor
added a commit
to dotnet/android
that referenced
this pull request
Sep 2, 2023
Changes: dotnet/java-interop@5adb4d4...5bb0d24 * dotnet/java-interop@5bb0d24b: [build] Add support for JDK 17 (dotnet/java-interop#1141) * dotnet/java-interop@7e3bd2f2: Revert "[build] Enable NuGet's Central Package Management (dotnet/java-interop#1114)" (dotnet/java-interop#1138) * dotnet/java-interop@7961b360: [build] set `$(DisableTransitiveFrameworkReferenceDownloads)`=true (dotnet/java-interop#1137) Context: #8304 Context: #8029 Context: https://web.archive.org/web/20230507035529/https://developer.android.com/studio/releases/#jdk-17 > Starting from Android Studio Flamingo Canary 3, the Studio IDE is > bundled with JDK 17. Because of #8029 we know we *can* use JDK 17. Because of #8304 we know we *should* use JDK 17. Update `xaprepare` so that Microsoft OpenJDK 17.0.8 is provisioned for the build. Note: `$(_JavacSourceVersion)` and `$(_JavacTargetVersion)` are *not* changed, so that our built `.jar` tooling can still *run* on JDK-11. Update to use Gradle 8.1.1. This is needed for JDK-17 support. Update `$(LatestSupportedJavaVersion)` to 17.0.99 so that JDK 17 can be used by .NET Android projects by default.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Update
<JdkInfo/>task to emit new$(Java*MajorVersion)and$(JavaApi*DefineConstants)MSBuild properties. These are used bysrc/Java.Baseso that it knows which JDK version it's binding.Update
src/Java.Baseto support binding thejava.base.jmodfrom JDK 17.Note: This "JDK-17 Java.Base binding" was a "time limited" effort.
To build against JDK-17:
Install JDK-17.
Prepare and override
$(JdksRoot):will use the Microsoft OpenJDK 17 installation on macOS.
Build: