SystemUtil.getJvmSpecInfo();
SystemUtil.getJvmInfo();
SystemUtil.getJavaSpecInfo();
SystemUtil.getJavaInfo();
SystemUtil.getJavaRuntimeInfo();
SystemUtil.getOsInfo();
SystemUtil.getUserInfo();
SystemUtil.getHostInfo();
SystemUtil.getRuntimeInfo();
<dependency>
<groupId>com.github.oshigroupId>
<artifactId>oshi-coreartifactId>
<version>5.6.1version>
dependency>
<dependency>
<groupId>net.java.dev.jnagroupId>
<artifactId>jnaartifactId>
<version>5.5.0version>
dependency>
<dependency>
<groupId>net.java.dev.jnagroupId>
<artifactId>jna-platformartifactId>
<version>5.5.0version>
dependency>
例如我们像获取CPU信息:
CpuInfo cpuInfo = OshiUtil.getCpuInfo();
net.java.dev.jna
jna
5.5.0
net.java.dev.jna
jna-platform
5.5.0