https://github.com/nrepl/nrepl-java-example
A simple example of embedding nREPL in a Java application
https://github.com/nrepl/nrepl-java-example
clojure java nrepl
Last synced: 6 months ago
JSON representation
A simple example of embedding nREPL in a Java application
- Host: GitHub
- URL: https://github.com/nrepl/nrepl-java-example
- Owner: nrepl
- Created: 2019-10-07T14:41:33.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2021-09-04T05:45:04.000Z (over 4 years ago)
- Last Synced: 2025-06-14T00:29:58.898Z (7 months ago)
- Topics: clojure, java, nrepl
- Language: Java
- Homepage:
- Size: 8.79 KB
- Stars: 7
- Watchers: 6
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# nREPL Java Example
This project contains a simple example of how to embed [nREPL](https://github.com/nrepl/nrepl) into a Java application.
## Requirements
- [Maven](https://maven.apache.org/)
- [Clojure CLI](https://clojure.org/guides/getting_started)
## How To Use
Open a terminal and run:
mvn compile clojure:compile exec:java
You should see a message saying that nrepl is started on port 7888. Next, open another terminal and run:
clj -Sdeps '{:deps {nrepl {:mvn/version "0.8.3"}}}' -M -m nrepl.cmdline --connect --host localhost --port 7888
This will create a client connection to the nrepl server.
Once connected, you can interact with the running application via the Clojure REPL. Some things to try:
- `(.shutdown org.nrepl.App/instance)` will shutdown the nrepl server (and disconnect your client)