@@ -389,7 +389,7 @@ GetJavaProperties(JNIEnv* env)
389
389
GetVersionEx ((OSVERSIONINFO * ) & ver );
390
390
majorVersion = ver .dwMajorVersion ;
391
391
minorVersion = ver .dwMinorVersion ;
392
- /* distinguish Windows Server 2016 and 2019 by build number */
392
+ /* distinguish Windows Server 2016+ by build number */
393
393
buildNumber = ver .dwBuildNumber ;
394
394
is_workstation = (ver .wProductType == VER_NT_WORKSTATION );
395
395
platformId = ver .dwPlatformId ;
@@ -474,6 +474,8 @@ GetJavaProperties(JNIEnv* env)
474
474
* Windows Server 2016 10 0 (!VER_NT_WORKSTATION)
475
475
* Windows Server 2019 10 0 (!VER_NT_WORKSTATION)
476
476
* where (buildNumber > 17762)
477
+ * Windows Server 2022 10 0 (!VER_NT_WORKSTATION)
478
+ * where (buildNumber > 20347)
477
479
*
478
480
* This mapping will presumably be augmented as new Windows
479
481
* versions are released.
@@ -549,7 +551,10 @@ GetJavaProperties(JNIEnv* env)
549
551
switch (minorVersion ) {
550
552
case 0 :
551
553
/* Windows server 2019 GA 10/2018 build number is 17763 */
552
- if (buildNumber > 17762 ) {
554
+ /* Windows server 2022 build number is 20348 */
555
+ if (buildNumber > 20347 ) {
556
+ sprops .os_name = "Windows Server 2022" ;
557
+ } else if (buildNumber > 17676 ) {
553
558
sprops .os_name = "Windows Server 2019" ;
554
559
} else {
555
560
sprops .os_name = "Windows Server 2016" ;
0 commit comments