java 打jar包配置文件和jar包通级

时间:2020-07-16 11:49:30   收藏:0   阅读:58

public class jarTs {
    public static void main(String[] args) throws IOException {
        String path =System.getProperty("user.dir");
        System.out.println("user.dir:  " + path);
        String proPath = path  + File.separator +"properties";
        FileInputStream in = new FileInputStream(proPath);
        Properties props = new Properties();
        props.load(in);
        in.close();
        String libPathKey = "lib_path";
        String libPath = props.getProperty(libPathKey);
        System.out.println("lib文件路径," + libPath);
    }
}

配置文件 properties

# ip and port of server socket
ip=127.0.0.2
lib_path = "D:\\Java_project\\faceRec2.0\\arcsoft_lib"
port=9999
# error message

 

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!