-
Bug
-
Resolution: Fixed
-
P2
-
5.0u2, 5.0u5
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-2130127 | 5.0u7 | Nishant Patel | P2 | Resolved | Fixed | b01 |
javac throws a ZipException if you have a non-jar/non-zip file in the classpath. For example, the following command on a Linux system throws an exception
$ javac -classpath .:/usr/lib/libm.so Test.java
The documentation says that it should ignore non-jar/non-zip files. See <http://java.sun.com/j2se/1.5.0/docs/tooldocs/solaris/classpath.html>. This is a regression from 1.4. 1.4 ignores such files, 1.5 does not. We see similar behaviour on our MacOSX version.
Looking at the code, I found the following code in src/share/classes/com/sun/tools/javac/util/Paths.java
/** Is this the name of a zip file? */
private static boolean isZip(String name) {
return new File(name).isFile();
}
This looks suspicious. It seems the code just checks to see if the file exists. It does not check to see if it is a valid zip file. bug 4971117 is slightly different but (I think) related to this bug.
Release Regression From : 5.0u2
The above release value was the last known release where this
bug was known to work. Since then there has been a regression.
###@###.### 2005-07-11 21:17:32 GMT
$ javac -classpath .:/usr/lib/libm.so Test.java
The documentation says that it should ignore non-jar/non-zip files. See <http://java.sun.com/j2se/1.5.0/docs/tooldocs/solaris/classpath.html>. This is a regression from 1.4. 1.4 ignores such files, 1.5 does not. We see similar behaviour on our MacOSX version.
Looking at the code, I found the following code in src/share/classes/com/sun/tools/javac/util/Paths.java
/** Is this the name of a zip file? */
private static boolean isZip(String name) {
return new File(name).isFile();
}
This looks suspicious. It seems the code just checks to see if the file exists. It does not check to see if it is a valid zip file. bug 4971117 is slightly different but (I think) related to this bug.
Release Regression From : 5.0u2
The above release value was the last known release where this
bug was known to work. Since then there has been a regression.
###@###.### 2005-07-11 21:17:32 GMT
- backported by
-
JDK-2130127 javac throws ZipException when you have invalid files in classpath
-
- Resolved
-
- duplicates
-
JDK-6343932 Zip error from javac when classpath includes the name of a plain (non-class) file
-
- Closed
-
- relates to
-
JDK-4977607 Compilation error java.lang.InternalError: jzentry == 0
-
- Resolved
-
-
JDK-6236704 bad jar files ignored in extension and endorsed dirs
-
- Resolved
-