Skip to content

Commit c67732a

Browse files
vieirojerboaa
authored andcommittedJan 29, 2025
8340387: Update OS detection code to recognize Windows Server 2025
Reviewed-by: stuefe, andrew Backport-of: d2b244d8de68caf911d0639abba802ead2620b2d
1 parent ecff933 commit c67732a

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed
 

‎src/hotspot/os/windows/os_windows.cpp

+4-1
Original file line numberDiff line numberDiff line change
@@ -1741,7 +1741,10 @@ void os::win32::print_windows_version(outputStream* st) {
17411741
// - 2016 GA 10/2016 build: 14393
17421742
// - 2019 GA 11/2018 build: 17763
17431743
// - 2022 GA 08/2021 build: 20348
1744-
if (build_number > 20347) {
1744+
// - 2025 Preview build : 26040
1745+
if (build_number > 26039) {
1746+
st->print("Server 2025");
1747+
} else if (build_number > 20347) {
17451748
st->print("Server 2022");
17461749
} else if (build_number > 17762) {
17471750
st->print("Server 2019");

‎src/java.base/windows/native/libjava/java_props_md.c

+7-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1998, 2020, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1998, 2024, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -486,6 +486,8 @@ GetJavaProperties(JNIEnv* env)
486486
* where (buildNumber > 17762)
487487
* Windows Server 2022 10 0 (!VER_NT_WORKSTATION)
488488
* where (buildNumber > 20347)
489+
* Windows Server 2025 10 0 (!VER_NT_WORKSTATION)
490+
* where (buildNumber > 26039)
489491
*
490492
* This mapping will presumably be augmented as new Windows
491493
* versions are released.
@@ -569,7 +571,10 @@ GetJavaProperties(JNIEnv* env)
569571
case 0:
570572
/* Windows server 2019 GA 10/2018 build number is 17763 */
571573
/* Windows server 2022 build number is 20348 */
572-
if (buildNumber > 20347) {
574+
/* Windows server 2025 Preview build is 26040 */
575+
if (buildNumber > 26039) {
576+
sprops.os_name = "Windows Server 2025";
577+
} else if (buildNumber > 20347) {
573578
sprops.os_name = "Windows Server 2022";
574579
} else if (buildNumber > 17676) {
575580
sprops.os_name = "Windows Server 2019";

1 commit comments

Comments
 (1)

openjdk-notifier[bot] commented on Jan 29, 2025

@openjdk-notifier[bot]
Please sign in to comment.