Fork me on GitHub
#tools-deps
<
2020-05-01
>
drewverlee22:05:56

whats the difference between -Jopt Pass opt through in java_opts, ex: -J-Xmx512m -Oalias... Concatenated jvm option aliases, ex: -O:mem the first is jsut for one option and the later is for multiple?

hiredman22:05:10

aliases are a feature of tools.deps, where you can kind of group alternative configurations together and give them a name, and -O lets you apply them

hiredman22:05:37

-J is for passing arguments directly to the command that launches the jvm, typically 'java'

drewverlee22:05:32

What would it look like to psas multiple arguments to the jvm? each one gets a J-<arg>

drewverlee22:05:45

clojure J-<arg> J-<arg>

hiredman22:05:56

passing arguments is bad wording on my part

hiredman22:05:17

it is passing options, flags like -Xmx512m

hiredman22:05:12

so for example, you could pass -J-server (which is the default these days)

drewverlee22:05:36

so for multiple its like clojure ... -J-Xmx512m -j-Xms512

seancorfield22:05:53

(! 613)-> clj -J-Dfoo=bar -J-Dquux=wibble
Clojure 1.10.1
user=> (System/getProperty "foo")
"bar"
user=> (System/getProperty "quux")
"wibble"
user=> ^D

hiredman22:05:18

I would put them first

seancorfield22:05:36

One -J per argument you want to pass. Beware of white space 🙂

hiredman22:05:53

when you run clojure or clj the argument handling is complicated

drewverlee22:05:59

nice. i didnt know about system/getProperty.

hiredman23:05:28

some arguments are for scripts, some for jvms, and some for clojure, and some for your code

hiredman23:05:44

clj/clojure also have another of different ways to combine aliases, but -A will usually do want you want

hiredman23:05:45

(aliases can also specify jvm options, and -O combines those ignoring the other stuff specified in the aliases)