FileNotFoundException after exporting as .jar file

∥☆過路亽.° 提交于 2019-11-30 23:57:08
Brian Agnew

When your app is exported as a jar, your config file is not available as a file, since it's wrapped up in the .jar file. Instead you should access it via ClassLoader.getResourceAsStream(). See this SO question for more background info.

Maybe this will help you

InputStream in=ClassLoader.getSystemResourceAsStream("your file");
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!