leventov / Koloboke

Java Collections till the last breadcrumb of memory and performance
https://koloboke.com/
1.01k stars 139 forks source link

Cannot init a basic map. #37

Open konstantinberlin opened 9 years ago

konstantinberlin commented 9 years ago

Hi,

I have download the 0.6.6 java 8 api files, and wrote this one line java main class which I took from the documentation example

package test2;

import java.util.Map;

import net.openhft.koloboke.collect.map.hash.HashIntIntMaps;

public class Try { public static void main(String[] args) { Map<Integer, Integer> map = HashIntIntMaps.newMutableMap();

}

}

I get this runtime error Exception in thread "main" java.lang.ExceptionInInitializerError at net.openhft.koloboke.collect.map.hash.HashIntIntMaps.getDefaultFactory(HashIntIntMaps.java:52) at net.openhft.koloboke.collect.map.hash.HashIntIntMaps.newMutableMap(HashIntIntMaps.java:76) at test2.Try.main(Try.java:11) Caused by: java.util.NoSuchElementException at java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:365) at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:404) at java.util.ServiceLoader$1.next(ServiceLoader.java:480) at net.openhft.koloboke.collect.map.hash.HashIntIntMaps$DefaultFactoryHolder.(HashIntIntMaps.java:37) ... 3 more

leventov commented 9 years ago

@konstantinberlin you should also have to have -impl jar in classpath. This Exception means API couldn't find any implementation.