I am trying to use EventBus from Google Guava libraries.
From the Guava documentation, it should be easy to instantiate an EventBus object.
My code is:
package test; import com.google.common.eventbus.EventBus; public class Test { public static void main(String[] args) { EventBus bus = new EventBus("Sample"); } }
I get this error:
Exception in thread "main" java.lang.NoSuchMethodError: com.google.common.base.Objects.firstNonNull(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object; at com.google.common.cache.CacheBuilder.getKeyStrength(CacheBuilder.java:355) at com.google.common.cache.CustomConcurrentHashMap.<init>(CustomConcurrentHashMap.java:206) at com.google.common.cache.ComputingCache.<init>(ComputingCache.java:39) at com.google.common.cache.CacheBuilder.build(CacheBuilder.java:569) at com.google.common.eventbus.EventBus.<init>(EventBus.java:156) at test.Test.main(Test.java:7) Java Result: 1
I tried with Guava 10.0, 11.0 and 12.0 and always with the same error. I am on OSX Lion and I am using Netbeans 7.1: I have tried both Java 6 (32 and 64 bit) and Java 7: no improvements. I can't find anything on google. Is this a problem with guava? Or, as usual, am I missing something?
Respectfully,
Alessandro
source share