Skip to content

Commit

Permalink
8340387: Update OS detection code to recognize Windows Server 2025
Browse files Browse the repository at this point in the history
Reviewed-by: mdoerr, jwaters, dholmes
  • Loading branch information
MBaesken committed Sep 23, 2024
1 parent dd49879 commit 34cddfb
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
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 @@ -1947,7 +1947,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, 2023, 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 @@ -444,6 +444,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 @@ -527,7 +529,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 > 17762) {
sprops.os_name = "Windows Server 2019";
Expand Down

7 comments on commit 34cddfb

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

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

@MBaesken
Copy link
Member Author

Choose a reason for hiding this comment

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

/backport jdk23u

@MBaesken
Copy link
Member Author

Choose a reason for hiding this comment

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

/backport jdk21u-dev

@openjdk
Copy link

@openjdk openjdk bot commented on 34cddfb Sep 24, 2024

Choose a reason for hiding this comment

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

@MBaesken the backport was successfully created on the branch backport-MBaesken-34cddfbe-master in my personal fork of openjdk/jdk23u. To create a pull request with this backport targeting openjdk/jdk23u:master, just click the following link:

➡️ Create pull request

The title of the pull request is automatically filled in correctly and below you find a suggestion for the pull request body:

Hi all,

This pull request contains a backport of commit 34cddfbe from the openjdk/jdk repository.

The commit being backported was authored by Matthias Baesken on 23 Sep 2024 and was reviewed by Martin Doerr, Julian Waters and David Holmes.

Thanks!

If you need to update the source branch of the pull then run the following commands in a local clone of your personal fork of openjdk/jdk23u:

$ git fetch https://github.com/openjdk-bots/jdk23u.git backport-MBaesken-34cddfbe-master:backport-MBaesken-34cddfbe-master
$ git checkout backport-MBaesken-34cddfbe-master
# make changes
$ git add paths/to/changed/files
$ git commit --message 'Describe additional changes made'
$ git push https://github.com/openjdk-bots/jdk23u.git backport-MBaesken-34cddfbe-master

@openjdk
Copy link

@openjdk openjdk bot commented on 34cddfb Sep 24, 2024

Choose a reason for hiding this comment

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

@MBaesken the backport was successfully created on the branch backport-MBaesken-34cddfbe-master in my personal fork of openjdk/jdk21u-dev. To create a pull request with this backport targeting openjdk/jdk21u-dev:master, just click the following link:

➡️ Create pull request

The title of the pull request is automatically filled in correctly and below you find a suggestion for the pull request body:

Hi all,

This pull request contains a backport of commit 34cddfbe from the openjdk/jdk repository.

The commit being backported was authored by Matthias Baesken on 23 Sep 2024 and was reviewed by Martin Doerr, Julian Waters and David Holmes.

Thanks!

If you need to update the source branch of the pull then run the following commands in a local clone of your personal fork of openjdk/jdk21u-dev:

$ git fetch https://github.com/openjdk-bots/jdk21u-dev.git backport-MBaesken-34cddfbe-master:backport-MBaesken-34cddfbe-master
$ git checkout backport-MBaesken-34cddfbe-master
# make changes
$ git add paths/to/changed/files
$ git commit --message 'Describe additional changes made'
$ git push https://github.com/openjdk-bots/jdk21u-dev.git backport-MBaesken-34cddfbe-master

@MBaesken
Copy link
Member Author

Choose a reason for hiding this comment

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

/backport jdk17u-dev

@openjdk
Copy link

@openjdk openjdk bot commented on 34cddfb Nov 6, 2024

Choose a reason for hiding this comment

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

@MBaesken the backport was successfully created on the branch backport-MBaesken-34cddfbe-master in my personal fork of openjdk/jdk17u-dev. To create a pull request with this backport targeting openjdk/jdk17u-dev:master, just click the following link:

➡️ Create pull request

The title of the pull request is automatically filled in correctly and below you find a suggestion for the pull request body:

Hi all,

This pull request contains a backport of commit 34cddfbe from the openjdk/jdk repository.

The commit being backported was authored by Matthias Baesken on 23 Sep 2024 and was reviewed by Martin Doerr, Julian Waters and David Holmes.

Thanks!

If you need to update the source branch of the pull then run the following commands in a local clone of your personal fork of openjdk/jdk17u-dev:

$ git fetch https://github.com/openjdk-bots/jdk17u-dev.git backport-MBaesken-34cddfbe-master:backport-MBaesken-34cddfbe-master
$ git checkout backport-MBaesken-34cddfbe-master
# make changes
$ git add paths/to/changed/files
$ git commit --message 'Describe additional changes made'
$ git push https://github.com/openjdk-bots/jdk17u-dev.git backport-MBaesken-34cddfbe-master

Please sign in to comment.