JDK-6408320 : os.name returns "Windows NT (unknown)" on Windows Vista
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.lang
  • Affected Version: 1.4.2_12,5.0u7
  • Priority: P2
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_vista
  • CPU: x86
  • Submitted: 2006-04-04
  • Updated: 2014-02-27
  • Resolved: 2006-04-10
Related Reports
Duplicate :  
Description
PROBLEM:
os.name returns "Windows NT (unknown)" on Windows Vista

IMPACT:
Deployment/Deployment, Deployment/Plugin tests etc which rely on os.name cannot run as results directory will be created as the following format:

$USER_NAME.Windows_NT_(unknown).x86

REPRODUCIBLE TESTCASE:
I used the following testcase:

import java.lang.*;

class Test
{
  public static void main(String args[])
  {
    System.out.println ("os.name = " + System.getProperty("os.name"));
    System.out.println ("os.arch = " + System.getProperty("os.arch"));
    System.out.println ("os.version = " + System.getProperty("os.version"));
  }
}

OUTPUT:
Compiled the file on windows-vista as follows:
c:/j2sdk1.4.2_12/bin/javac Test.java

Ran it with following output:
c:/j2sdk1.4.2_12/bin/java Test
os.name = Windows NT (unknown)
os.arch = x86
os.version = 6.0

If I compile the file and run on windows-vista with mustang:
c:/jdk1.6.0/bin/javac Test
c:/jdk1.6.0/bin/java Test
os.name = Windows Vista
os.arch = x86
os.version = 6.0

NOTES:
Windows Vista (TM) Beta 2 - Build 5308.