Windows 2012 R2/2016下Java系统属性返回值及全OS属性列表查询
Java System Property Values for Windows Server 2012 R2 & 2016
Hey there! I’ve got you covered on this since you’re building a jjs script but don’t have access to those Windows Server environments. Let’s break this down:
Exact Property Values for Your Target Servers
Here’s what java.lang.System.getProperty() returns for the three properties you’re asking about:
Windows Server 2012 R2
os.name:"Windows Server 2012 R2"os.arch:"x86"(for 32-bit systems) or"amd64"(for 64-bit systems — note Java uses "amd64" for all 64-bit Windows builds, regardless of CPU manufacturer)os.version:"6.3"(this maps to the Windows kernel version, which matches Windows 8.1)
Windows Server 2016
os.name:"Windows Server 2016"os.arch:"x86"(32-bit) or"amd64"(64-bit)os.version:"10.0"(shares the same kernel as Windows 10)
Is There a Comprehensive List of All OS Property Values?
Unfortunately, there’s no official, fully up-to-date, all-inclusive list from Oracle or OpenJDK that covers every possible OS variant and its corresponding system property values. The reason is simple: OS vendors (like Microsoft) release new versions, editions, and updates over time, and Java’s property values evolve alongside them.
That said, here are some practical ways to get reliable info:
- Test with minimal code: If you can find someone with access to these servers, ask them to run a quick jjs one-liner:
print(java.lang.System.getProperty("os.name")); print(java.lang.System.getProperty("os.arch")); print(java.lang.System.getProperty("os.version")); - Community-curated resources: Various developers have compiled non-official lists of common OS property values over time. These are usually shared in forums, GitHub gists, or technical blogs — just keep in mind they might not include every niche edition or the latest updates.
- Java documentation: The official Java docs outline what each system property represents, but they don’t list every possible value for every OS. For example, they’ll tell you
os.namereturns the OS name, but not the exact string for every Windows Server version.
内容的提问来源于stack exchange,提问作者blekione
相关产品推荐
相关产品推荐

