我已将资源文件保存在作为共享模块的主jar的resource文件夹下。我正在尝试使用
访问文件 File pdf1File = new File (getClass().getClassLoader().getResource("com/org/pack/Page2_Template.pdf").getFile());
我也尝试过resourceAsStream()
。
这是错误:
... 3 more
Caused by: java.io.FileNotFoundException: C:\wildfly\content\my-ear.ear\lib\my-jar-6.8.0.0.11-RELEASE-SNAPSHOT.jar\com\org\pack1\Page1_Template.pdf (The system cannot find the path specified)