Java's “os.name” for Windows 10?

后端 未结 5 1332
离开以前
离开以前 2020-12-01 13:49

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

5条回答
  •  不思量自难忘°
    2020-12-01 13:59

    Hm... I don't know if it is a fix of Windows 10(10.0.17134.590) or of Java 8(1.8.0_171-b11 for me), but it is correct now: os.name gives me Windows 10.

    Besides, if you don't trust it, you can check os.version. I have 10.0.

    (By the way, I see os.arch:amd64. This is of JVM, not of OS. )

提交回复
热议问题