@Chetan I reduced the workaround to a one-liner, that is independant from language setting.
** Description changed: looks like there is an open bug for windows 11 that is expected to be fixed in java 18 https://bugs.openjdk.java.net/browse/JDK-8274840 tracked on GitHub: https://github.com/RaiMan/SikuliX1/issues/479 + IMHO this is not really a Java bug, but a quirk in Windows 11 + + systeminfo shows this (language German): + + Betriebssystemname: Microsoft Windows 11 Pro + Betriebssystemversion: 10.0.22000 Nicht zutreffend Build 22000 + + So the version is actually shown as 10.0 which is reported by Java + ---------------------------------------------------------------------- --- workaround --- - in Python scripting for other user who may see similar issue + (based on Chetan's idea from comment #7) - get OS details from sysinfo + windowsVersion = run("systeminfo").split("\n")[2].split(":")[1].strip() + print windowsVersion - cmd='powershell\nsysteminfo | findstr /B /C:\"OS Name\"' - cmdoutput=ExecuteWinCommand(cmd) + will show on Win11: Microsoft Windows 11 Pro - def ExecuteWinCommand(cmdToExecute): - returnCode = runScript(cmdToExecute) - commandOutput = RunTime.get().getLastCommandResult() - sleep(2) - return commandOutput - + (only tested on Win11 - hope it works on Win10 too) -------------------------------------------------------------- Env.getOSVersion() gets incorrect version for Windows 11 we are expecting version to be returned as 11 but get 10.0 OS: Win 11 Java : 14 ** Summary changed: - [2.0.5] Win11: Env.getOSVersion() gets incorrect version (10.0) --- Java problem (fixed with Java18) + [2.0.5] Win11: Env.getOSVersion() gets incorrect version (10.0) --- Java/Windows problem (fixed with Java18??) ** Description changed: + tracked on GitHub: https://github.com/RaiMan/SikuliX1/issues/479 + ---------------------------------------------------------------- + looks like there is an open bug for windows 11 that is expected to be fixed in java 18 https://bugs.openjdk.java.net/browse/JDK-8274840 - - tracked on GitHub: https://github.com/RaiMan/SikuliX1/issues/479 IMHO this is not really a Java bug, but a quirk in Windows 11 systeminfo shows this (language German): Betriebssystemname: Microsoft Windows 11 Pro Betriebssystemversion: 10.0.22000 Nicht zutreffend Build 22000 So the version is actually shown as 10.0 which is reported by Java ---------------------------------------------------------------------- --- workaround --- (based on Chetan's idea from comment #7) windowsVersion = run("systeminfo").split("\n")[2].split(":")[1].strip() - print windowsVersion + print windowsVersion will show on Win11: Microsoft Windows 11 Pro (only tested on Win11 - hope it works on Win10 too) -------------------------------------------------------------- Env.getOSVersion() gets incorrect version for Windows 11 we are expecting version to be returned as 11 but get 10.0 OS: Win 11 Java : 14 -- You received this bug notification because you are a member of Sikuli Drivers, which is subscribed to SikuliX. https://bugs.launchpad.net/bugs/1946925 Title: [2.0.5] Win11: Env.getOSVersion() gets incorrect version (10.0) --- Java/Windows problem (fixed with Java18??) Status in SikuliX: Confirmed Bug description: tracked on GitHub: https://github.com/RaiMan/SikuliX1/issues/479 ---------------------------------------------------------------- looks like there is an open bug for windows 11 that is expected to be fixed in java 18 https://bugs.openjdk.java.net/browse/JDK-8274840 IMHO this is not really a Java bug, but a quirk in Windows 11 systeminfo shows this (language German): Betriebssystemname: Microsoft Windows 11 Pro Betriebssystemversion: 10.0.22000 Nicht zutreffend Build 22000 So the version is actually shown as 10.0 which is reported by Java ---------------------------------------------------------------------- --- workaround --- (based on Chetan's idea from comment #7) windowsVersion = run("systeminfo").split("\n")[2].split(":")[1].strip() print windowsVersion will show on Win11: Microsoft Windows 11 Pro (only tested on Win11 - hope it works on Win10 too) -------------------------------------------------------------- Env.getOSVersion() gets incorrect version for Windows 11 we are expecting version to be returned as 11 but get 10.0 OS: Win 11 Java : 14 To manage notifications about this bug go to: https://bugs.launchpad.net/sikuli/+bug/1946925/+subscriptions _______________________________________________ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp