I need a jar file to access some files. I know how to do this for BufferedImage , but this does not work for other files. All I want to do is extract some lightning from my can. I created a class folder in eclipse, placed the zip inside and used
public File getResFile(String name){ return new File(getClass().getResource(name).getFile()); }
to get an instance of File and extract it. it works fine in eclipse, but as soon as I export it to the jar, it says
Exception in thread "main" java.io.FileNotFoundException: file:\C:\Users\DeLL\Desktop\BoxcraftClient\ClientInstaller.jar!\client.bxc (The filename, directory name, or volume label syntax is incorrect) at java.util.zip.ZipFile.open(Native Method) at java.util.zip.ZipFile.<init>(ZipFile.java:220) at java.util.zip.ZipFile.<init>(ZipFile.java:150) at java.util.zip.ZipFile.<init>(ZipFile.java:164) at Launcher.install(Launcher.java:43) at Launcher.main(Launcher.java:33)
Im working to fix this for about 6 hours and cannot find a solution. Please, help!
java eclipse jar zip
Areg Hovhannisyan Oct 21 '15 at 16:43 2015-10-21 16:43
source share