United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
JDK-5032358 : "java.util.zip.ZipException: The system cannot find the file specified"

Details
Type:
Enhancement
Submit Date:
2004-04-15
Status:
Resolved
Updated Date:
2009-07-17
Project Name:
JDK
Resolved Date:
2009-07-17
Component:
core-libs
OS:
solaris_9,generic,windows_xp
Sub-Component:
java.util.jar
CPU:
x86,sparc,generic
Priority:
P4
Resolution:
Fixed
Affected Versions:
1.4.0,1.4.2,1.4.2_03,5.0
Fixed Versions:

Related Reports
Duplicate:
Duplicate:
Duplicate:
Relates:
Relates:

Sub Tasks

Description
When one invokes java with a wrong file name like this:

  $ java -jar nosuchfile.jar

You get:

java.util.zip.ZipException: The system cannot find the file specified
        at java.util.zip.ZipFile.open(Native Method)
        at java.util.zip.ZipFile.<init>(ZipFile.java:112)
        at java.util.jar.JarFile.<init>(JarFile.java:127)
        at java.util.jar.JarFile.<init>(JarFile.java:65)

This also happens with programatic invocation of new JarFile(...);
But as you see it doesn't actually print the file name, which makes the debugging unnecessarily hard.
###@###.### 2004-04-15

                                    

Comments
EVALUATION

The FileNotFoundException is thrown on Windows platform alreays after switched to winFileHandleOpen for long path support.
                                     
2009-06-03
CONVERTED DATA

BugTraq+ Release Management Values

COMMIT TO FIX:
dragon


                                     
2004-06-14
EVALUATION

Yes, it would be very good to emit a better error message.
Not just here, but in other places within jar/zip.

The jar command should explicitly catch FileNotFoundException,
(among others) and issue a nice informative localized message.

###@###.### 2004-04-15
                                     
2004-04-15



Hardware and Software, Engineered to Work Together