frog:~/workspaces/test/New107 $ cat -n T.java
1 import java.util.*;
2
3 class T {
4 static {
5 Collections.EmptySet t = null;
6 }
7 }
frog:~/workspaces/test/New107 $ newjavac T.java
+ exec /usr/java1.5/bin/javac -J-esa -source 1.5 -target 1.4 T.java
T.java:5: cannot access java.util.Collections.EmptySet
bad class file: /usr/java1.5/jre/lib/rt.jar/java/util/Collections$EmptySet.class
undeclared type variable: E
Please remove or make sure it appears in the correct subdirectory of the classpath.
Collections.EmptySet t = null;
^
1 error
frog:~/workspaces/test/New107 $
1 import java.util.*;
2
3 class T {
4 static {
5 Collections.EmptySet t = null;
6 }
7 }
frog:~/workspaces/test/New107 $ newjavac T.java
+ exec /usr/java1.5/bin/javac -J-esa -source 1.5 -target 1.4 T.java
T.java:5: cannot access java.util.Collections.EmptySet
bad class file: /usr/java1.5/jre/lib/rt.jar/java/util/Collections$EmptySet.class
undeclared type variable: E
Please remove or make sure it appears in the correct subdirectory of the classpath.
Collections.EmptySet t = null;
^
1 error
frog:~/workspaces/test/New107 $
- duplicates
-
JDK-4970828 complains bad class file when trying ocompile a valid Java file
-
- Resolved
-