Monica视频监控处理程序
add
xc
2021-08-16 209c26e699ba9b5f12855772b59618ce1a423da9
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
package com.hbbh.adapter.utils;
 
 
import java.util.Properties;
 
/**
 * 环境变量工具
 * for fameview
 */
public class PathUtil {
 
 
    private static final String key= "java.library.path";
    private static final String path="user.dir";
    //Windows
    private static final String regex_win= ";";
    // mac
    private static final String regex_mac= ":";
 
    private static final String _mac= "mac";
    private static final String _windows= "windows";
 
    private static final String os_name= "os.name";
 
 
    /**
     * 输出
     * 1.当前程序必须在Windows环境运行
     * 2.第三方依赖包存放位置
     * 3.环境变量所在位置
     */
    public static void printLibrary(){
        String regex=null;
        String osName = System.getProperty(os_name).toLowerCase();
        if (osName.contains(_mac)){
            System.out.println("警告:当前程序必须在Windows环境下执行");
            regex=regex_mac;
        }else if (osName.contains(_windows)){
            regex=regex_win;
        }else if (null==osName){
            System.out.println("警告:当前程序必须在Windows环境下执行");
            regex=regex_win;
        }
 
        System.out.println("当前运行操作系统:"+osName);
        System.out.println("-------------- 引入第三方包环境变量 -------------- ");
        String property = System.getProperty(key);
        if (property.contains(regex)) {
            String[] split = property.split(regex);
            for (String s : split) {
                System.out.println("需要在文件--> "+s+"  | 下放置依赖包");
            }
        } else {
            System.out.println("需要在文件--> "+property+"  | 下放置依赖包");
        }
        System.out.println("-------------- 或者重新制定环境变量 ------------------- ");
    }
 
    public static void main(String[] args) {
        //printLibrary();
        Properties properties = System.getProperties();
    }
 
 
}