1、正常打成jar包
2、修改jar包中的MANIFEST.MF文件,添加Class-Path: lib/xxx.jar lib/xxx.jar,Class-Path: 后边有一个空格
3、在存放jar包的目录下创建lib文件夹,将引用的xxx.jar等jar包拷贝进去即可
=========================================================
jar包引用properties文件
String proFilePath = System.getProperty("user.dir") + "\\config.properties";
ResourceBundle bundle = null;
try {
InputStream in = new BufferedInputStream(new FileInputStream(proFilePath));
bundle = new PropertyResourceBundle(in);
} catch (IOException e) {
e.printStackTrace();
}
linux下需把配置文件放到调用者同级目录