java.io.FileNotFoundException when image file is inside jar using jxl.write.WritableImage
I am using WritableImage to write image into xls file, when I run it inside eclipse it is working fine. But when I run it in executable jar, I getting FileNotFoundException. WritableImage image = new WritableImage(0.0D, 0.0D, 1.0D, 3.0D, new File(getClass().getResource("/img/abouts.png").getPath())); The image is indeed inside the jar. C:\scheduler-1.0-SNAPSHOT-jar-with-dependencies.jar\img\abouts.png Here's the exception: java.io.FileNotFoundException: file:C:<some directory>scheduler-1.0-SNAPSHOT-jar-with-dependencies.jar!/scheduler.jar!/img/abouts.png (No such file or directory) at java.io