打包成可执行 jar 后出现 FileNotFoundException
使用 Maven Shade 插件并运行可执行 jar 后,我的应用程序由于 FileNotFoundException 失败。在应用程序开发过程中,我将文件放在 src/main/resources 中,因此我的路径定义如下“src/main/resources/maps/map.shp”。我应该更改代码中的所有路径吗?我应该怎么做?为什么会发生这种情况?
Exception in thread "main" java.io.FileNotFoundException: C:\Users\ilija\Desktop
\MavenizedCP\cp-map\target\src\main\resources\maps\ParcelsCountyRDMFinal5.shp (T
he system cannot find the path specified)
After using maven shade plugin and running the executable jar, my application failed due to FileNotFoundException. During the application development I put my files in src/main/resources and so my path was defined like this "src/main/resources/maps/map.shp". Should I change all my paths in the code and how should I do that? Why does this happen?
Exception in thread "main" java.io.FileNotFoundException: C:\Users\ilija\Desktop
\MavenizedCP\cp-map\target\src\main\resources\maps\ParcelsCountyRDMFinal5.shp (T
he system cannot find the path specified)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论