JAVA取得操作系统类型 代码如下: System.err.println(System.getProperty("os.name")); 在win10环境下,输出: Windows 10 在centos下,输出: Linux Please enable JavaScript to view the comments powered by Disqus. Post Directory