Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
*/
public abstract class ArchivedOracleJdkToolchainResolver extends AbstractCustomJavaToolchainResolver {

private static final Map<Integer, String> ARCHIVED_BASE_VERSIONS = Maps.of(20, "20.0.2", 19, "19.0.2", 18, "18.0.2.1");
private static final Map<Integer, String> ARCHIVED_BASE_VERSIONS = Maps.of(21, "21.0.6", 20, "20.0.2", 19, "19.0.2", 18, "18.0.2.1");

@Override
public Optional<JavaToolchainDownload> resolve(JavaToolchainRequest request) {
Expand Down
28 changes: 28 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,34 @@ allprojects {
apply plugin: 'elasticsearch.formatting'
}

tasks.named("updateDaemonJvm") {
def myPlatforms = [
BuildPlatformFactory.of(
org.gradle.platform.Architecture.AARCH64,
org.gradle.platform.OperatingSystem.MAC_OS
),
BuildPlatformFactory.of(
org.gradle.platform.Architecture.AARCH64,
org.gradle.platform.OperatingSystem.LINUX
),
BuildPlatformFactory.of(
org.gradle.platform.Architecture.X86_64,
org.gradle.platform.OperatingSystem.LINUX
),
BuildPlatformFactory.of(
org.gradle.platform.Architecture.X86_64,
org.gradle.platform.OperatingSystem.WINDOWS
),
// anyone still using x86 osx?
BuildPlatformFactory.of(
org.gradle.platform.Architecture.X86_64,
org.gradle.platform.OperatingSystem.MAC_OS
)
]
toolchainPlatforms.set(myPlatforms)
languageVersion = JavaLanguageVersion.of(21)
Copy link
Contributor Author

@breskeby breskeby Mar 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jozala brought up that those archived oracle jdks are not openjdk anymore and we might hit a license issue here. I wonder if we are okay here or if we should maybe use a different openjdk vendor. @mark-vieira do you have thoughts on this?. IMO since this is build vm only. the safest way might be using adoptium

Copy link
Contributor

@mark-vieira mark-vieira Mar 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I forget the exact license terms. We aren't "redistributing" so we're probably ok, but I guess it would be considered "commercial use". If there are any concerns I agree that just using Adoptium would be easiest. We're not picky here, since this is only used by build-time toolchains.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lets go with the Adoptium jvm then for the gradle jvm

vendor = JvmVendorSpec.ADOPTIUM
}

tasks.register("verifyBwcTestsEnabled") {
doLast {
Expand Down
8 changes: 8 additions & 0 deletions gradle/gradle-daemon-jvm.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#This file is generated by updateDaemonJvm
Copy link
Contributor

@mark-vieira mark-vieira Mar 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah I see. It doesn't actually do dynamic resolution. This is still way better than the status quo though of people running into random issues when using new JDKs. And this rarely will need to be updated.

toolchainUrl.LINUX.AARCH64=https\://api.adoptium.net/v3/binary/version/jdk-21.0.6+7/linux/aarch64/jdk/hotspot/normal/eclipse?project\=jdk
toolchainUrl.LINUX.X86_64=https\://api.adoptium.net/v3/binary/version/jdk-21.0.6+7/linux/x64/jdk/hotspot/normal/eclipse?project\=jdk
toolchainUrl.MAC_OS.AARCH64=https\://api.adoptium.net/v3/binary/version/jdk-21.0.6+7/mac/aarch64/jdk/hotspot/normal/eclipse?project\=jdk
toolchainUrl.MAC_OS.X86_64=https\://api.adoptium.net/v3/binary/version/jdk-21.0.6+7/mac/x64/jdk/hotspot/normal/eclipse?project\=jdk
toolchainUrl.WINDOWS.X86_64=https\://api.adoptium.net/v3/binary/version/jdk-21.0.6+7/windows/x64/jdk/hotspot/normal/eclipse?project\=jdk
toolchainVendor=ADOPTIUM
toolchainVersion=21