Skip to content

Commit

Permalink
Clarify JVMTI agent docs
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-yakushev committed Jun 3, 2024
1 parent ea7db44 commit 3c11193
Showing 1 changed file with 29 additions and 5 deletions.
34 changes: 29 additions & 5 deletions doc/modules/ROOT/pages/basics/up_and_running.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -206,11 +206,35 @@ so we'll examine them tool by tool.

==== Enabling nREPL JVMTI agent

Since version 1.2.0, nREPL ships together with a native JVMTI agent, so that the
eval interrupts properly work on Java 21 and later. To enable the agent, the
Java process should be launched with `-Djdk.attach.allowAttachSelf`. CIDER will
do it automatically during jack-in if `cider-enable-nrepl-jvmti-agent` is set to
`t`.
Since version 1.2.0, nREPL includes a native JVMTI agent which makes the eval
interrupts work properly on Java 21 and later. To enable the agent, the Java
process should be launched with `-Djdk.attach.allowAttachSelf`. CIDER will do it
automatically during jack-in if `cider-enable-nrepl-jvmti-agent` variable is set
to `t`.

[IMPORTANT]
====
`cider-enable-nrepl-jvmti-agent` has no effect if you start a REPL
process outside of Emacs and connect to it with `cider-connect`. In that
scenario, you have to add `-Djdk.attach.allowAttachSelf` Java property manually
through the means of the build tool. In Leiningen, add this to `project.clj`:
[source,lisp]
---
:jvm-opts ["-Djdk.attach.allowAttachSelf"]
---
In tools.deps, add this to one of the aliases that you enable with the REPL:
[source,lisp]
---
{:aliases
{:dev
{:jvm-opts ["-Djdk.attach.allowAttachSelf"]
...}}}
---
====

==== Leiningen Options

Expand Down

0 comments on commit 3c11193

Please sign in to comment.