Skip to content

Commit 3c11193

Browse files
Clarify JVMTI agent docs
1 parent ea7db44 commit 3c11193

File tree

1 file changed

+29
-5
lines changed

1 file changed

+29
-5
lines changed

doc/modules/ROOT/pages/basics/up_and_running.adoc

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -206,11 +206,35 @@ so we'll examine them tool by tool.
206206

207207
==== Enabling nREPL JVMTI agent
208208

209-
Since version 1.2.0, nREPL ships together with a native JVMTI agent, so that the
210-
eval interrupts properly work on Java 21 and later. To enable the agent, the
211-
Java process should be launched with `-Djdk.attach.allowAttachSelf`. CIDER will
212-
do it automatically during jack-in if `cider-enable-nrepl-jvmti-agent` is set to
213-
`t`.
209+
Since version 1.2.0, nREPL includes a native JVMTI agent which makes the eval
210+
interrupts work properly on Java 21 and later. To enable the agent, the Java
211+
process should be launched with `-Djdk.attach.allowAttachSelf`. CIDER will do it
212+
automatically during jack-in if `cider-enable-nrepl-jvmti-agent` variable is set
213+
to `t`.
214+
215+
[IMPORTANT]
216+
====
217+
`cider-enable-nrepl-jvmti-agent` has no effect if you start a REPL
218+
process outside of Emacs and connect to it with `cider-connect`. In that
219+
scenario, you have to add `-Djdk.attach.allowAttachSelf` Java property manually
220+
through the means of the build tool. In Leiningen, add this to `project.clj`:
221+
222+
[source,lisp]
223+
---
224+
:jvm-opts ["-Djdk.attach.allowAttachSelf"]
225+
---
226+
227+
In tools.deps, add this to one of the aliases that you enable with the REPL:
228+
229+
[source,lisp]
230+
---
231+
{:aliases
232+
{:dev
233+
{:jvm-opts ["-Djdk.attach.allowAttachSelf"]
234+
...}}}
235+
---
236+
237+
====
214238

215239
==== Leiningen Options
216240

0 commit comments

Comments
 (0)