DaveAKing / guava-libraries

Automatically exported from code.google.com/p/guava-libraries
Apache License 2.0
0 stars 0 forks source link

Guava 15 doesn't work on Oracle Java 7u40 #1539

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
java.lang.VerifyError: class com.google.common.collect.EmptyImmutableList 
overrides final method toArray.([Ljava/lang/Object;)[Ljava/lang/Object;

The 14.0.1 version works perfectly.  

Original issue reported on code.google.com by sspirido...@gmail.com on 20 Sep 2013 at 9:58

GoogleCodeExporter commented 9 years ago
This sounds like there may be multiple versions of Guava on the classpath. If 
the problem started with 7u40 or 14.0.1, that may mean that the JDK happens to 
load a different version of one of the classes than it did with previous 
versions.

I've tried to reproduce the problem but had no luck. If I can reproduce your 
setup, I can investigate further.

$ cat Foo.java
import com.google.common.collect.ImmutableList;

public class Foo {
  public static void main(String[] args) {
    ImmutableList.of().toArray();
    ImmutableList.of().toArray(new Object[0]);
  }
}
$ /tmp/jdk1.7.0_40/bin/javac -cp $HOME/guava-15.0.jar Foo.java && 
/tmp/jdk1.7.0_40/bin/java -cp .:$HOME/guava-15.0.jar Foo
<success>

Original comment by cpov...@google.com on 20 Sep 2013 at 1:41

GoogleCodeExporter commented 9 years ago
Hmm, yes, there are definitely two versions of Guava on the classpath. You can 
tell because EmptyImmutableList doesn't exist in Guava 15.

Original comment by cpov...@google.com on 20 Sep 2013 at 1:45

GoogleCodeExporter commented 9 years ago
This issue has been migrated to GitHub.

It can be found at https://github.com/google/guava/issues/<issue id>

Original comment by cgdecker@google.com on 1 Nov 2014 at 4:12

GoogleCodeExporter commented 9 years ago

Original comment by cgdecker@google.com on 3 Nov 2014 at 9:08