I'm trying to use lmdbjava in Clojure, but I'm struggling.
(import '[org.lmdbjava Env])
(def path (clojure.java.io/file "/tmp"))
(.open (.setMaxDbs (.setMapSize (Env/create) 10485760) 1) path)
(p.s. I realise there are cleaner ways. This is just for testing purposes.)
This is the error:
IllegalArgumentException No matching method found: open for class java.lang.Class clojure.lang.Reflector.invokeMatchingMethod (Reflector.java:53)
I've also tried this:
(.open (.setMaxDbs (.setMapSize (Env/create) 10485760) 1) path org.lmdbjava.EnvFlags/MDB_NOLOCK)
and this:
(.. (Env/create) (setMapSize 10485760) (setMaxDbs 1) (open path org.lmdbjava.EnvFlags/MDB_NOLOCK))
And I get this error:
ClassCastException org.lmdbjava.EnvFlags (in module: Unnamed Module) cannot be cast to [Lorg.lmdbjava.EnvFlags; (in module: Unnamed Module) user/eval1339 (form-init2868059116743223586.clj:1)
I realise I'm probably doing something daft, because I'm new to both Java and Clojure. Any help would be greatly appreciated!
By the way, this is the tutorial I'm following:
https://github.com/lmdbjava/lmdbjava/blob/master/src/test/java/org/lmdbjava/TutorialTest.java
Thanks!