判断程序运行系统环境

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

}
posted @ 2019-10-21 18:00  软工风少  阅读(279)  评论(0)    收藏  举报