Skip to content
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

8340387: Update OS detection code to recognize Windows Server 2025 #2977

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
5 changes: 4 additions & 1 deletion src/hotspot/os/windows/os_windows.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1741,7 +1741,10 @@ void os::win32::print_windows_version(outputStream* st) {
// - 2016 GA 10/2016 build: 14393
// - 2019 GA 11/2018 build: 17763
// - 2022 GA 08/2021 build: 20348
if (build_number > 20347) {
// - 2025 Preview build : 26040
if (build_number > 26039) {
st->print("Server 2025");
} else if (build_number > 20347) {
st->print("Server 2022");
} else if (build_number > 17762) {
st->print("Server 2019");
Expand Down
9 changes: 7 additions & 2 deletions src/java.base/windows/native/libjava/java_props_md.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -486,6 +486,8 @@ GetJavaProperties(JNIEnv* env)
* where (buildNumber > 17762)
* Windows Server 2022 10 0 (!VER_NT_WORKSTATION)
* where (buildNumber > 20347)
* Windows Server 2025 10 0 (!VER_NT_WORKSTATION)
* where (buildNumber > 26039)
*
* This mapping will presumably be augmented as new Windows
* versions are released.
Expand Down Expand Up @@ -569,7 +571,10 @@ GetJavaProperties(JNIEnv* env)
case 0:
/* Windows server 2019 GA 10/2018 build number is 17763 */
/* Windows server 2022 build number is 20348 */
if (buildNumber > 20347) {
/* Windows server 2025 Preview build is 26040 */
if (buildNumber > 26039) {
sprops.os_name = "Windows Server 2025";
} else if (buildNumber > 20347) {
sprops.os_name = "Windows Server 2022";
} else if (buildNumber > 17676) {
sprops.os_name = "Windows Server 2019";
Expand Down