判断程序运行系统环境
判断程序运行系统环境,可以用于本地与服务器自动切换
Properties prop = System.getProperties();
String os = prop.getProperty("os.name");
System.out.println(os.toLowerCase());
if (os != null && os.toLowerCase().indexOf("linux") > -1) {
} else {
}
本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。
如有问题,可以通过邮件985843242@qq.com联系。欢迎共同交流讨论。