United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
JDK-6220825 : System property os.name should be "Windows Vista" on Windows Vista

Details
Type:
Bug
Submit Date:
2005-01-24
Status:
Resolved
Updated Date:
2010-12-08
Project Name:
JDK
Resolved Date:
2005-11-21
Component:
core-libs
OS:
windows_vista,windows
Sub-Component:
java.lang
CPU:
x86,generic
Priority:
P3
Resolution:
Fixed
Affected Versions:
3.2,1.4.2_12,5.0u7,6
Fixed Versions:

Related Reports
Backport:
Backport:
Duplicate:
Relates:

Sub Tasks

Description
System.getProperty("os.name") on Longhorn preview release returns "Windows NT (unknown)".  Windows java_props_md.c will have to be updated to recognize Windows "Longhorn" once the official major/minor version and the official OS name for Longhorn is released.

###@###.### 2005-1-24 18:23:19 GMT

                                    

Comments
EVALUATION

I've updated the synopsis to a user-meaningful one instead of
an implementor-meaningful one.
                                     
2006-04-10
EVALUATION

I've applied the suggested fix and verified that it works on Windows Vista (beta2).
                                     
2005-10-27
SUGGESTED FIX

--- /tmp/geta15954	2005-10-07 13:01:19.575267800 -0700
+++ java_props_md.c	2005-10-07 12:48:21.916143000 -0700
@@ -599,66 +599,54 @@
 	 * Windows 98			4		10
 	 * Windows ME			4		90
 	 * Windows 3.51			3		51
 	 * Windows NT 4.0		4		0
 	 * Windows 2000			5		0
 	 * Windows XP			5		1
 	 * Windows Server 2003 family	5		2
+	 * Windows Vista		6		0
 	 *
 	 * This mapping will presumably be augmented as new Windows
 	 * versions are released.
 	 */
 	switch (ver.dwPlatformId) {
 	case VER_PLATFORM_WIN32s:
 	    sprops.os_name = "Windows 3.1";
 	    break;
 	case VER_PLATFORM_WIN32_WINDOWS:
            if (ver.dwMajorVersion == 4) {
                 switch (ver.dwMinorVersion) {
-                case 0:
-                    sprops.os_name = "Windows 95";
-                    break;
-                case 10:
-                    sprops.os_name = "Windows 98";
-                    break;
-                case 90:
-                    sprops.os_name = "Windows Me";
-                    break;
-                default:
-                    sprops.os_name = "Windows 9X (unknown)";
+                case  0: sprops.os_name = "Windows 95";           break;
+                case 10: sprops.os_name = "Windows 98";           break;
+                case 90: sprops.os_name = "Windows Me";           break;
+                default: sprops.os_name = "Windows 9X (unknown)"; break;
                 }
             } else {
                 sprops.os_name = "Windows 9X (unknown)";
             }
             break;
 	case VER_PLATFORM_WIN32_NT:
             if (ver.dwMajorVersion <= 4) {
 	        sprops.os_name = "Windows NT";
             } else if (ver.dwMajorVersion == 5) {
 	        switch (ver.dwMinorVersion) {
-		case 0:
-		    sprops.os_name = "Windows 2000";
-		    break;
-	        case 1:
-		    sprops.os_name = "Windows XP";
-		    break;
-	        case 2:
-		    sprops.os_name = "Windows 2003";
-		    break;
-	        default:
-		    sprops.os_name = "Windows NT (unknown)";
-		    break;
-	      }
+		case  0: sprops.os_name = "Windows 2000";         break;
+	        case  1: sprops.os_name = "Windows XP";           break;
+	        case  2: sprops.os_name = "Windows 2003";         break;
+	        default: sprops.os_name = "Windows NT (unknown)"; break;
+		}
+            } else if (ver.dwMajorVersion == 6) {
+		sprops.os_name = "Windows Vista";
             } else {
                 sprops.os_name = "Windows NT (unknown)";
             }
 	    break;
         default:
-            sprops.os_name = "Windows (unknown)";
-            break;
+	    sprops.os_name = "Windows (unknown)";
+	    break;
 	}
 	sprintf(buf, "%d.%d", ver.dwMajorVersion, ver.dwMinorVersion);
 	sprops.os_version = strdup(buf);
 #if _M_IA64
         sprops.os_arch = "ia64";
 #elif _M_AMD64
         sprops.os_arch = "amd64";
                                     
2005-10-07
EVALUATION

Yup.
###@###.### 2005-1-26 00:01:32 GMT
                                     
2005-01-24



Hardware and Software, Engineered to Work Together