My Oracle Support Banner

System.getProperty("os.name") Returns "Windows Server 2016" on Windows Server 2022 (Doc ID 2965321.1)

Last updated on AUGUST 03, 2023

Applies to:

Java SE JDK and JRE - Version 7 to 17
Information in this document applies to any platform.

Symptoms

On Windows Server 2022, System.getProperty("os.name") incorrectly returns "Windows Server 2016". The application fails to run, and the following fatal error is seen in the application log:


The issue can be reproduced by running any program that uses getProperty("os.name") with any of the following Java SE versions and updates:

Cause

To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!


In this Document
Symptoms
Cause
Solution
References


My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.