Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8287891

System.getProperty("os.version") not reporting correct value for Windows 11

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • P4
    • Resolution: Not an Issue
    • 8u331
    • None
    • hotspot
    • generic
    • windows

    Description

      ADDITIONAL SYSTEM INFORMATION :
      JRE 1.8.0_331 running on Windows 11 Home, version 21H2, build 22000.652.

      A DESCRIPTION OF THE PROBLEM :
      Running JRE 1.8.0_331 when I call System.getProperty("os.name") call returns "Windows 11" which is correct since I am running on Windows 11. However, when I call System.getProperty("os.version") returns "10.0"!

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Execute the following Java code:

      System.getProperty("os.name"); // Which will correctly return "Windows 11"
      System.getProperty("os.version"); // Which will incorrectly return "10.0"!

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      I expected System.getProperty("os.version") to return "11.0".
      ACTUAL -
      "10.0"

      ---------- BEGIN SOURCE ----------
      See "Steps to reproduce"
      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      One could query "os.name" and do some parsing and for each os but I believe the purpose of having these system properties is so programmers don't have to write such code.

      FREQUENCY : always


      Attachments

        Issue Links

          Activity

            People

              rsurianaraya Rajagopal Surianarayanan
              webbuggrp Webbug Group
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: