Fork me on GitHub
#tools-deps
<
2021-12-06
>
hugod21:12:10

Is it expected behaviour that a top level :jvm-opts in deps.edn is ignored?

Alex Miller (Clojure team)21:12:07

yeah, that's not a feature

Alex Miller (Clojure team)21:12:33

there is an ask question at https://ask.clojure.org/index.php/7834/support-default-jvm-opts?show=7834#q7834 about this if you want to vote on it. (but I think it's unlikely that that will be the final answer)

hugod21:12:16

OK, thanks Alex.

hugod21:12:43

Is it possible to introspect the command line arguments from a running JVM?

Alex Miller (Clojure team)22:12:18

generically, not that I'm aware of

jumar22:12:19

It's probably better to use an external tool for that - either checking the cmd line or using something like jcmd, JMC, etc.

jumar22:12:08

Since JDK 9, you can also use ProcessHandle if this is what you are after:

(-> (java.lang.ProcessHandle/current) .info .commandLine .get)
EDIT: or this to get only the args
(-> (java.lang.ProcessHandle/current) .info .arguments .get)

😎 1
hugod14:12:58

thanks @U06BE1L6T - that’s useful to assert that the jvm options are getting set

borkdude21:12:54

There is also a clj-kondo issue about it: https://github.com/clj-kondo/clj-kondo/issues/1269 Feel free to upvote using a thumbs up.

dominicm21:12:43

Just wanted to drop a note that the new :classpath-roots and :classpath apis are fantastic, I've been able to simplify a bunch of code AND better align with how tdeps behaves 🙂

👍 1