In Java, we can see the property value of os.name
to know the name of the underlying operating system: System.getProperty("os.name")
.
For each edition of Windows, it used to return always the exact name of the OS: Windows XP
for XP, Windows Vista
for Vista, Windows 7
for Seven, Windows 8.1
for 8.1, and so on...
The problem is: I just updated my Windows 8.1 to Windows 10 using the released Microsoft updater, and it seems like this property still remains Windows 8.1
:
public class OSTest {
public static void main(String[] args) {
System.out.println(System.getProperty("os.name"));
}
}
How can I create a workaround for this? And, does anyone know if this problem persists if installing a fresh Windows 10 copy - that is, this bug is caused by the Microsoft auto-updater -?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…