Details
-
Enhancement
-
Resolution: Fixed
-
P3
-
11, 13, 15, 17, 18, 19
Backports
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8287941 | 18u-cpu | Christoph Langer | P3 | Resolved | Fixed | master |
JDK-8287598 | 18.0.2 | Christoph Langer | P3 | Resolved | Fixed | b09 |
JDK-8291857 | 17.0.6-oracle | Christian Stein | P3 | Resolved | Fixed | b01 |
JDK-8287989 | 17.0.5 | Christoph Langer | P3 | Resolved | Fixed | b01 |
JDK-8287789 | 17.0.4 | Christoph Langer | P3 | Resolved | Fixed | b06 |
JDK-8289807 | 15.0.9 | Yuri Nesterenko | P3 | Resolved | Fixed | b01 |
JDK-8289812 | 13.0.13 | Yuri Nesterenko | P3 | Resolved | Fixed | b01 |
JDK-8291858 | 11.0.18-oracle | Christian Stein | P3 | Resolved | Fixed | b01 |
JDK-8287996 | 11.0.17 | Christoph Langer | P3 | Resolved | Fixed | b01 |
JDK-8287790 | 11.0.16 | Christoph Langer | P3 | Resolved | Fixed | b06 |
Description
Hello.java:1: error: cannot access unnamed package
import java.util.Date;
^
ZIP file can't be opened as a file system because an entry has a '.' or '..' element in its name
1 error
The error is caused by some now invalid jar file (due to . or .. in entry names) which does not necessarily have to do with the compilation unit on which the error is thrown. The error message does not give a clue which jar file is causing the problem. This can be improved to something like:
Hello.java:1: error: cannot access unnamed package
import java.util.Date;
^
ZipException opening "invalid.jar": ZIP file can't be opened as a file system because an entry has a '.' or '..' element in its name
1 error
To recreate, I have attached a little Java program "GenerateInvalidJar" that generates an invalid jar named invalid.jar which is attached as binary, too. Then, you can call javac -cp invalid.jar Hello.java to provoke the error.
Attachments
Issue Links
- backported by
-
JDK-8287598 javac errors after JDK-8251329 are not helpful enough to find root cause
- Resolved
-
JDK-8287789 javac errors after JDK-8251329 are not helpful enough to find root cause
- Resolved
-
JDK-8287790 javac errors after JDK-8251329 are not helpful enough to find root cause
- Resolved
-
JDK-8287941 javac errors after JDK-8251329 are not helpful enough to find root cause
- Resolved
-
JDK-8287989 javac errors after JDK-8251329 are not helpful enough to find root cause
- Resolved
-
JDK-8287996 javac errors after JDK-8251329 are not helpful enough to find root cause
- Resolved
-
JDK-8289807 javac errors after JDK-8251329 are not helpful enough to find root cause
- Resolved
-
JDK-8289812 javac errors after JDK-8251329 are not helpful enough to find root cause
- Resolved
-
JDK-8291857 javac errors after JDK-8251329 are not helpful enough to find root cause
- Resolved
-
JDK-8291858 javac errors after JDK-8251329 are not helpful enough to find root cause
- Resolved
- relates to
-
JDK-8283486 ZIP file can't be opened as a file system because an entry has a '.' or '..' element in its name
- Open
-
JDK-8286855 javac error on invalid jar should only print filename
- Resolved
-
JDK-8251329 (zipfs) Files.walkFileTree walks infinitely if zip has dir named "." inside
- Closed
-
JDK-8286594 (zipfs) Mention paths with dot elements in ZipException and cleanups
- Resolved
- links to
-
Commit openjdk/jdk11u/3f9d7310
-
Commit openjdk/jdk13u-dev/36be252d
-
Commit openjdk/jdk15u-dev/876be7f5
-
Commit openjdk/jdk17u/4a19cdca
-
Commit openjdk/jdk18u/e2acd4fc
-
Commit openjdk/jdk/29c4b8e8
-
Review openjdk/jdk11u-dev/1117
-
Review openjdk/jdk11u/37
-
Review openjdk/jdk13u-dev/365
-
Review openjdk/jdk15u-dev/226
-
Review openjdk/jdk17u-dev/424
-
Review openjdk/jdk17u/340
-
Review openjdk/jdk18u/143
-
Review openjdk/jdk/8616