String path = getClass().getProtectionDomain().getCodeSource().getLocation().getPath(); 必须是在非静态方法中才可以使用