admin
2021-09-30 1a1a315efb1b5dc294013126f35819e36565040c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
package org.yeshi.utils;
 
public class SystemUtil {
    public final static int SYSTEM_WINDOWS = 1;
    public final static int SYSTEM_LINUX = 2;
 
    /**
     * 获取操作系统类型
     *
     * @return
     */
    public static int getSystemType() {
        String os = System.getProperty("os.name");
        if (os.toLowerCase().startsWith("win"))
            return SYSTEM_WINDOWS;
        else
            return SYSTEM_LINUX;
    }
 
}