Get OS-level system information

后端 未结 16 1978
情话喂你
情话喂你 2020-11-22 02:02

I\'m currently building a Java app that could end up being run on many different platforms, but primarily variants of Solaris, Linux and Windows.

Has anyone been abl

16条回答
  •  野趣味
    野趣味 (楼主)
    2020-11-22 02:37

    It is still under development but you can already use jHardware

    It is a simple library that scraps system data using Java. It works in both Linux and Windows.

    ProcessorInfo info = HardwareInfo.getProcessorInfo();
    //Get named info
    System.out.println("Cache size: " + info.getCacheSize());        
    System.out.println("Family: " + info.getFamily());
    System.out.println("Speed (Mhz): " + info.getMhz());
    //[...]
    

提交回复
热议问题