Fork me on GitHub

what's the right way of writing the jvm option in a deps.edn file?

{:jvm-opts ["-Dsnoop.enabled"]
 :deps {}}
I can write -J-Dsnoop.enabled=true on the command line, and I would like the deps.edn equivalent

Alex Miller (Clojure team)21:03:45

there is no way to provide a global jvm opt

๐Ÿ™Œ 1
Alex Miller (Clojure team)21:03:08

you can provide them in an alias with :jvm-opts as you have above and then use the alias

๐Ÿ™Œ 1
Alex Miller (Clojure team)22:03:14

{:aliases {:snoop {:jvm-opts ["-Dsnoop.enabled"]}}}

clj -A:snoop


thanks! I'm sure there has to be a reason for that, but I don't see it at first glance


do you happen to have any insight on why that has to be the case?

Alex Miller (Clojure team)22:03:14

most jvm options don't make sense for the open world of all possible programs you might run in a project

๐Ÿ™Œ 1
Alex Miller (Clojure team)22:03:39

so I'm not terribly convinced yet that this is a good feature to have :)


I see, thank you! ๐Ÿ™‚


I've just added some pages on JVM options, showing how to use them with Clojure CLI. There are also a number of examples and There are a lot of options to choose from ๐Ÿ™‚ It would be very interesting to know which options are commonly used. I've put together Appreciate any corrections if something is not quite right.

๐Ÿ˜ 1
Alex Miller (Clojure team)01:03:10

I would definitely add the OmitStackTrace one

Alex Miller (Clojure team)01:03:40


๐Ÿ‘ 1
Alex Miller (Clojure team)01:03:19

That is the most common jvm option I use

Alex Miller (Clojure team)01:03:38

And probably next most common are the โ€”illegal-access flags - debug and deny


Interesting. It seems the --illegal-access flag was marked deprecated in Java 16, with So maybe one day it will be less common :)

Alex Miller (Clojure team)02:03:01

That's actually great, I'm glad they switched the default to deny as that means the reflection canAccess methods will actually work

Alex Miller (Clojure team)02:03:58

The Clojure reflector uses that feedback to look further up the inheritance chain for a public method to call

๐Ÿ‘ 1
Ben Sless06:03:14

Aren't server and tiered compilation on by default?