Processing 2.1 fails to compile all of its projects using JDK8 EA b119 error: The type java.util.Map$Entry cannot be resolved. #2260

Closed
xranby opened this Issue Dec 13, 2013 · 5 comments

Comments

Projects
None yet
3 participants
Contributor

xranby commented Dec 13, 2013

Processing 2.1 fails to compile all of its projects using JDK8 EA b119
error: The type java.util.Map$Entry cannot be resolved.

This issue is reported to:
https://bugs.openjdk.java.net/browse/JDK-8024935 - compilation succeeds in java7 but fails in java8
http://mail.openjdk.java.net/pipermail/quality-discuss/2013-December/000204.html

steps to reproduce:

Download JDK8 EA b119 from:

https://jdk8.java.net/download.html

cd processing-2.1

replace the bundled jdk inside processing with JDK8 EA b119

mv java java-bundled
mv jdk1.8.0 java

run

./processing

Press
Sketch->Run
without entering any code fails with the following output:

Annotation processing got disabled, since it requires a 1.6 compliant JVM
/tmp/sketch_131213a3040094527895471164temp/sketch_131213a.java:1: error: The type java.util.Map$Entry cannot be resolved. It is indirectly referenced from required .class files
import processing.core.*;
^
1 problem (1 error)

Well that is the point, requires a 1.6 compliant compiler. This is normal with java, a feature gets deprecated, then it is supported for a while (like for the following generation compiler). Then kerplunk it is no longer supported in subsequent versions (jdk8 is not released until next year, and the java folks have been known to change their minds). I have been experimenting with jdk8 myself, as a runtime for processing (jdk7 compiled) /ruby-processing all seems to work well (improved garbage collection etc).

Contributor

xranby commented Dec 16, 2013

It appears that JDK 8 do not work well in combination with ecj and the -source argument.

Processing internally used the Eclipse ecj compiler:
The following code and command can reproduce the issue in combination with JDK 8 b119:

$ cat HelloWorld.java
import java.util.HashMap;

public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello World!");
}
}

#download the eclipse ecj version used internally by processing.
wget https://github.com/processing/processing/raw/master/java/mode/ecj.jar

tar zxvf jdk-8-ea-bin-b119-linux-i586-05_dec_2013.tar.gz

./jdk1.8.0/bin/java -jar ecj.jar -source 1.6 -classpath . -nowarn HelloWorld.java

Annotation processing got disabled, since it requires a 1.6 compliant JVM

  1. ERROR in HelloWorld.java (at line 1)
    import java.util.HashMap;
    ^
    The type java.util.Map$Entry cannot be resolved. It is indirectly referenced from required .class files

    1 problem (1 error)

Compilation fails similarly using -source 7 as well.

The compilation succeed if ecj.jar is invoked without the -source 1.6 argument:

./jdk1.8.0/bin/java -jar ecj.jar -classpath . -nowarn HelloWorld.java
./jdk1.8.0/bin/java HelloWorld
Hello World!

Owner

benfry commented Jan 22, 2014

JDK 8 is unreleased software... There's no chance we're going to support early access releases of Java.

@benfry benfry closed this Jan 22, 2014

Contributor

xranby commented Mar 18, 2014

Happy #openjdk 8 release day!

@weitzj weitzj referenced this issue in SeleniumHQ/selenium May 3, 2014

Closed

Eclipse Compiler Update for Java8 support #213

andreastt added a commit to SeleniumHQ/selenium that referenced this issue May 4, 2014

Eclipse compiler update for Java 8 support
See https://bugs.eclipse.org/bugs/show_bug.cgi?id=396000 and
processing/processing#2260

Verified against Eclipse project with md5sum
8075a8fbdac1452e0ddb6bda8a5d953b.

Signed-off-by: Andreas Tolfsen <ato@mozilla.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment