Skip to content

Commit 233c4b2

Browse files
committed
Add some useful JVM flags
1 parent a614b7d commit 233c4b2

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

src/lambdaisland/launchpad.clj

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,21 @@
306306
:java-args conj
307307
"-XX:-OmitStackTraceInFastThrow"))
308308

309+
(defn stack-traces-to-stderr
310+
"Make Clojure print out its stack traces, instead of writing them to a file"
311+
[ctx]
312+
(update ctx
313+
:java-args conj
314+
"-Dclojure.main.report=stderr"))
315+
316+
(defn jdk-allow-attach-self
317+
"Set the allowAttachSelf property, needed on JDK21+ in order to cancel
318+
evaluation."
319+
[ctx]
320+
(update ctx
321+
:java-args conj
322+
"-Djdk.attach.allowAttachSelf"))
323+
309324
(defn inject-aliases-as-property [{:keys [aliases] :as ctx}]
310325
(update ctx
311326
:java-args conj
@@ -563,6 +578,8 @@
563578
maybe-go
564579
;; extra java flags
565580
disable-stack-trace-elision
581+
stack-traces-to-stderr
582+
jdk-allow-attach-self
566583
inject-aliases-as-property
567584
include-watcher
568585
print-summary

0 commit comments

Comments
 (0)