Java Jdk 1.7 64 Bit Download
Java Jdk 1.7.0
jsr166 maintainers are very sorry for the trouble that ConcurrentHashMap$KeySetView has caused. Here's the workaround: import java.util.concurrent.ConcurrentHashMap; import java.util.Map; public class CHM_keySet { public static void main(String[] args) throws Throwable { ConcurrentHashMap<Long,Long> m = new ConcurrentHashMap<>(); // Workaround ... System.out.println(((Map) m).keySet()); // ... for NoSuchMethodError from: System.out.println(m.keySet()); } } | FYI, this is precisely the use case of for the -release flag added to javac in JDK 9 under JEP 247: Compile for Older Platform Versions (JDK-8058150). | 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: /opt/JDK/8/re/b40/bin/javac -source 7 -target 7 -Xlint CHMCompilationTest.java warning: [options] bootstrap class path not set in conjunction with -source 1.7 <-------------------------------------------------- 1 warning /usr/lib/jvm/java-1.7.0-openjdk-amd64/bin/java CHMCompilationTest Exception in thread 'main' java.lang.NoSuchMethodError: java.util.concurrent.ConcurrentHashMap.keySet()Ljava/util/concurrent/ConcurrentHashMap$KeySetView; at CHMCompilationTest.main(CHMCompilationTest.java:8) To address this: /opt/JDK/8/re/b40/bin/javac -Xbootclasspath/p:/usr/lib/jvm/java-1.7.0-openjdk-amd64/jre/lib/rt.jar -Xlint -source 7 -target 7 CHMCompilationTest.java [no warnings!] maurizio@mc:~/Desktop$ /usr/lib/jvm/java-1.7.0-openjdk-amd64/bin/java CHMCompilationTest [] | Test Result: ########## OS: Windows 7 64-bit JDK: javac 7uXX java 7uXX : Pass javac 7uXX java 8uXX : Pass javac 7uXX java 9ea : Pass javac 8uXX java 7uXX : Fail javac 9ea java 7uXX : Fail javac 9ea java 8uXX : Pass ################################################################################################################################ javac 7uXX and java 7uXX ###################### c:jitools>javac -version javac 1.7.0_51 c:jitools>java CHMCompilationTest Exception in thread 'main' java.lang.NoSuchMethodError: java.util.concurrent.ConcurrentHashMap.keySe at CHMCompilationTest.main(CHMCompilationTest.java:8) c:jitools>javac -source 1.7 -target 1.7 CHMCompilationTest.java c:jitools>javac -version javac 1.7.0_51 c:jitools>java CHMCompilationTest [] ################################################################################################################################ javac 7uXX java 8uXX ################### c:jitools>javac -version javac 1.7.0_51 c:jitools>javac -source 1.7 -target 1.7 CHMCompilationTest.java c:jitools>javac -version javac 1.8.0_74 c:jitools>java CHMCompilationTest [] ################################################################################################################################ javac 9ea and java 8uXX #################### c:jitools>javac -version javac 9-ea c:jitools>javac -source 1.8 -target 1.8 CHMCompilationTest.java warning: [options] bootstrap class path not set in conjunction with -source 1.8 1 warning c:jitools>javac -version javac 1.8.0_74 c:jitools>java CHMCompilationTest [] ################################################################################################################################ javac 9ea and java 7uXX ##################### c:jitools>javac -version javac 9-ea c:jitools>javac -source 1.7 -target 1.7 CHMCompilationTest.java warning: [options] bootstrap class path not set in conjunction with -source 1.7 1 warning c:jitools>javac -version javac 1.7.0_51 c:jitools>java CHMCompilationTest Exception in thread 'main' java.lang.NoSuchMethodError: java.util.concurrent.ConcurrentHashMap.keySet()Ljava/util/concurrent/ConcurrentHashMap$KeySetVi at CHMCompilationTest.main(CHMCompilationTest.java:8) c:jitools> ################################################################################################################################ |
|
Java Jdk 1.7
Java™ SE Development Kit 7, Update 95 (JDK 7u95) The full version string for this update release is 1.7.095-b14 (where 'b' means 'build'). The version number is 7u95. This update release contains several enhancements and changes including the following: IANA Data 2015g. JDK 7u95 contains IANA time zone data version 2015g. JDK 1.7.009 and JDK 1.6.037 have been released see By 2012-01-16T17:00PDT I will have updated the. Yes, you can use Java 1.7 for the Android development. You must keep source compatibility with Java 6 during compile and only the next problem is because of the changed default algorithm for jarsigner. This is solved in Stack Overflow question Android signing with Ant (workaround). But it is already fixed in Ant.