Patch for workaround to build with OpenJDK6
I am trying to build IDEA checked out from git and I get the error below. Is there a patch or workaround for this error?
Thanks
[java] [javac] PathsList.java:109: incompatible types; no instance(s) of type variable(s) T exist so that java.util.Iterator<T> conforms to java.util.Iterator<java.lang.String>
[java] [javac] found : <T>java.util.Iterator<T>
[java] [javac] required: java.util.Iterator<java.lang.String>
[java] [javac] return FilteringIterator.create(iterate(en), new Condition<String>() {
[java] [javac] ^
[java] [javac] Note: Some input files additionally use or override a deprecated API.
[java] [javac] Note: Some input files use unchecked or unsafe operations.
[java] [javac] Note: Recompile with -Xlint:unchecked for details.
[java] [javac] 1 error
[java] [javac] 100 warnings
[java]
[java] BUILD FAILED
[java] /home/git/idea/build/gant.xml:17: : Compile failed; see the compiler error output for details.
[java]
[java] Total time: 39 seconds
I have Icetea6 installed and there was a bugzilla entry (787) reporting this and that was closed as a won't fix....
Created attachment 570 [details] Reduced test case The attached test case was derived from IntelliJ IDEA, which fails to build using IcedTea. The same case works fine with Sun JDK. Does not work with IcedTea: $ java -version java version "1.6.0_22" OpenJDK Runtime Environment (IcedTea6 1.10.3) (Gentoo build 1.6.0_22-b22) OpenJDK 64-Bit Server VM (build 20.0-b11, mixed mode) $ javac IcedTeaTest.java IcedTeaTest.java:9: incompatible types; no instance(s) of type variable(s) T exist so that java.util.Iterator<T> conforms to java.util.Iterator<java.lang.String> found : <T>java.util.Iterator<T> required: java.util.Iterator<java.lang.String> return TestIterator.create(bar()); ^ 1 error Works with Sun JDK $ java -version java version "1.6.0_27" Java(TM) SE Runtime Environment (build 1.6.0_27-b07) Java HotSpot(TM) 64-Bit Server VM (build 20.2-b06, mixed mode) $ javac IcedTeaTest.java $ ls IcedTeaTest.class IcedTeaTest.java TestIterator.class
I am getting this also but not sure if it is an icedtea or openjdk issue. I even tried the mercurial version just to see if it was fixed there. java -version java version "1.6.0_24" OpenJDK Runtime Environment (IcedTea6 1.11pre+r0a0072170876+) (Source Mage build 1.6.0_24-b24) OpenJDK 64-Bit Server VM (build 20.0-b12, mixed mode)
This looks like the same issue as RH706066/S6369605 fixed in OpenJDK7: http://hg.openjdk.java.net/jdk7/jdk7/langtools/rev/dc550520ed6f I've confirmed by applying the patch and trying to re-compile the test. It was rejected from application to IcedTea. You can find the discussion in this thread: http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2011-June/014574.html Since the concerns for backport still stand, I would suggest manually specifying the type parameters in your code instead of having the compiler infer them. That is what Denis's patch did for commons-discovery: https://issues.apache.org/jira/browse/DISCOVERY-18 I am going to close this as WONTFIX.
Please sign in to leave a comment.