How do I programmatically determine operating system in Java?

后端 未结 19 2519
眼角桃花
眼角桃花 2020-11-22 04:56

I would like to determine the operating system of the host that my Java program is running programmatically (for example: I would like to be able to load different propertie

相关标签:
19条回答
  • 2020-11-22 05:33

    Try this,simple and easy

    System.getProperty("os.name");
    System.getProperty("os.version");
    System.getProperty("os.arch");
    
    0 讨论(0)
提交回复
热议问题