Closed vinurs closed 11 months ago
The jvm-opts
are a runtime flag, so you'd have to supply them when you're running the jar as well.
@yogthos how can i fix this for bb uberjar
The module gets loaded from the JVM runtime, so it's bnot part of the jar. You just have to pass the flags to the JVM when running the uberjar.
Now the problem is, when i add require in some clj file like this
(:require [libpython-clj2.require :refer [require-python]]
[libpython-clj2.python :refer [py. py.. py.-] :as py]
)
then i can't use bb uberjar
to generate the jar, Just prompt me the error above
i modified build.clj, and add :java-opts
fix it
--- a/build.clj
+++ b/build.clj
@@ -38,6 +38,7 @@
(println "Compiling Clojure...")
(b/compile-clj {:base base
:src-dirs: ["src/clj", "resources", "env/prod/resources", "env/prod/clj"]
+ :java-opts["--add-modules", "jdk.incubator.foreign,jdk.incubator.vector": "--enable-native-access=ALL-UNNAMED"]
:class-dir class-dir})
(println "Making uberjar...")
Ah yeah that works.
i'm trying use https://github.com/clj-python/libpython-clj in this project, i'm using openjdk version "17.0.7" 2023-04-18, so i add this jvm-opts
when i use
bb cider
it works with python, but when i want to build it usingbb uberjar
, it outputs the errorbut i've add the