使用java类加载器,报异常java.nio.file.InvalidPathException

String path = Label.class.getClassLoader().getResource("").getPath();

/F:/idea-Java/ImageDemo/out/production/ImageDemo

实质去掉最左边的斜杠就可以了。

String subpath = path.substring(1);

posted @ 2019-06-11 13:20  soft.push("zzq")  Views(4606)  Comments(0)    收藏  举报