Fork me on GitHub
#datalevin
<
2022-09-10
>
kokonut16:09:04

I am in a situation where I need to use java 17 and I think I need to add the jvm options recommended (datalevin worked fine with Java 11 on my setting based upon leiningen). So I added :jvm-opts part like below but still not working. Can someone let me know if this look right?

(defproject ... "0.1.0-SNAPSHOT"
  ...
  :dependencies [[datalevin "0.6.16"]
                 [metosin/reitit "0.5.18"]
                 [org.clojure/clojure "1.10.0"]
                 [ring/ring-jetty-adapter "1.9.5"]]
  :jvm-opts ["--add-opens=java.base/java.nio=ALL-UNNAMED"
             "--add-opens=java.base/sun.nio.ch=ALL-UNNAMED"]) 

kokonut16:09:25

Fyi, this is the log message I am currently getting.

Execution error (InaccessibleObjectException) at java.lang.reflect.AccessibleObject/checkCanSetAccessible (AccessibleObject.java:354).
Unable to make field long java.nio.Buffer.address accessible: module java.base does not "opens java.nio" to unnamed module @202b84a6
ERROR: Unhandled REPL handler exception processing message {:op stacktrace, :nrepl.middleware.print/stream? 1, :nrepl.middleware.print/print cider.nrepl.pprint/pprint, :nrepl.middleware.print/quota 1048576, :nrepl.middleware.print/buffer-size 4096, :nrepl.middleware.print/options {:right-margin 70}, :session 362ae053-b433-4eb6-9618-d0167b312a90, :id 9}
java.util.concurrent.ExecutionException: java.lang.NoClassDefFoundError: Could not initialize class org.lmdbjava.ByteBufferProxy
	at java.base/java.util.concurrent.FutureTask.report(FutureTask.java:122)
	at java.base/java.util.concurrent.FutureTask.get(FutureTask.java:191)

Huahai16:09:04

You have wrong syntax.

Huahai16:09:32

:jvm-opts [“--add-opens” “java.base/java.nio=ALL-UNNAMED” “--add-opens” “java.base/java.lang=ALL-UNNAMED” “--add-opens” “java.base/sun.nio.ch=ALL-UNNAMED” “--add-opens” “java.base/jdk.internal.ref=ALL-UNNAMED”]

👍 1
Huahai16:09:51

above are what in the project.clj of datalevin code base

kokonut17:09:55

I got it. Thanks!

Mike Engelhart12:09:35

@U0A74MRCJ I’m also running into this problem with deps.edn. I followed the instructions in one of the github issues related to this but your example shows starting the application with the command line. I’m trying to simply test out datalevin and the sample for deps.edn doesn’t work with cider-jack-in in Emacs. Any idea on how to configure this for Cider and working in a repl?

Huahai19:09:18

I don't know how cider uses deps.edn, maybe ask in cider channel?