gpt4 book ai didi

jar - 按路径从 Jar 文件

转载 作者:行者123 更新时间:2023-12-04 04:50:15 27 4
gpt4 key购买 nike

我在复制 jar 中的文件时遇到问题:

URI ink2_1 = this.getClass().getClassLoader().getResource("Masi_INK2.bmp").toURI();
...
Files.copy(Paths.get(sourceFile1), Paths.get(IAIOutputFile+requestId+"_INK1.bmp"));

路径无法通过路径解析
15:43:11,505 INFO  [MainFake] searching for jar:file:/C:/workspace/clone/Tools/DummySimulator/DummySimulator-1.0-SNAPSHOT.jar!/Masi_INK2.bmp
15:43:11,505 INFO [MainFake] Exception in thread "main" java.nio.file.FileSystemNotFoundException
at com.sun.nio.zipfs.ZipFileSystemProvider.getFileSystem(ZipFileSystemProvider.java:171)
at com.sun.nio.zipfs.ZipFileSystemProvider.getPath(ZipFileSystemProvider.java:157)
at java.nio.file.Paths.get(Unknown Source)
at com.example.MainFake.processImages(MainFake.java:101)

最佳答案

This bug仍然存在于 7u25 中。

关于jar - 按路径从 Jar 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17550870/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com