标签:property sys java key message 路径 exce int str
类
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
标签:property sys java key message 路径 exce int str
原文地址:https://www.cnblogs.com/wt7018/p/13320743.html