判断程序运行系统环境,可以用于本地与服务器自动切换
Properties prop = System.getProperties();
String os = prop.getProperty("os.name");
System.out.println(os.toLowerCase());
if (os != null && os.toLowerCase().indexOf("linux") > -1) {
} else {
}
原文:https://www.cnblogs.com/why5125/p/11715045.html