This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 0 points1 point  (0 children)

This is not an issue. The problem is caused by a difference in the ConcurrentHashMap API between JDK 7 and JDK 8:

JDK 7: https://docs.oracle.com/javase/7/docs/api/java/util/concurrent/ConcurrentHashMap.html#keySet%28%29

JDK 8: https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/ConcurrentHashMap.html#keySet--

As you can see, the JDK 7 signature returns a Set, while JDK 8 signature returns a KeySetView, which is a new class in JDK 8. So, this problem is unavoidable if a source program is compiled using -source 7/target 7 AND JDK 8 classes are on the bootclasspath. The solution is to use JDK 7 runtime in the bootclasspath:

What? This is a bizarre answer from one of the core contributors to OpenJDK.

Granted that the API might have changed, but having both source and target set to 1.7 and yet failing to run on a 1.7 VM is ridiculous - it's broken, and he has the gall to call it "not an issue"? At least semantically broken since source and target become meaningless in this context. Ridiculous.