问题
I'm trying to find out the system architecture using Java and I've tried out:
operatingSystemMXBean.getArch()
and
String sys1=System.getProperty("sun.arch.data.model")
but I get amd64
when I'm using an Intel 64 bit processor.
I've read this article on Wiki to clear up my concepts. Am I missing something? Also, how can I get the actual System architecture using Java so that I get an output saying Intel 64? Thanks!
回答1:
Intel 64-Bit-Processors use the amd-architecture. That's why many systems note that as amd64, the alternative synonym is x64 or x86-64 for both.
回答2:
the AMD64 bit was patented by AMD, and Intel licenses their AMD64 architecture. Thus, you get AMD64 as architecture on an Intel CPU.
Still,
System.out.println(System.getenv("PROCESSOR_IDENTIFIER"));
will give you more CPU info, some of which is whether it is an Intel or AMD cpu!
回答3:
You might want to consider this package:
Sigar (org.hyperic.sigar.CpuInfo), You can find the javadoc
here
Not sure, it might be an overkill, but it supposed to give you all the information you need about your system (including the CPU information in the class above)
This package is free under the Apache License 2.0.
来源:https://stackoverflow.com/questions/8076366/finding-out-sytem-architecture-using-java