How to connect to the REPL in Cursive?

#1

Hello, I’ve found the project with several issues for beginners & I’m currently trying to run dev version of this project

There is the command you need to run to start the REPL, but it won’t be connected the editor

.PHONY: clj-dev
clj-dev:
	clj -A:dev${CLJ_REPL_ALIAS}

Screenshot%20from%202019-04-27%2020-34-49

Is there any way to run this REPL from Cursive?

#2

The error seems to be

adress already in use

Do you happen to have another services using port 8880, 8080, 8777 or 8877?

From what I can see those port are used by the application: For barista it uses port 8877 and port 8880

And for storefront it uses port 8080 and 8777

#3

Thank you for your response :slight_smile:

Yes, you’re right about another services using these ports

The problem unfortunately stays the same: I am not able to setup integrated Cursive REPL

I am only able to run REPL from the command line through make clj-dev command, so it not accessible from Intellij

#4

Did you have a look at the Cursive doc in the section Remote REPL

In theory you should be able to get it setup by:

  • Opening a separate terminal and run the command make clj-dev
  • In IntelliJ IDEA, following the docs for Remote REPL, you create a new config for Clojure REPL -> Remote -> You enter 127.0.0.1 as the host and the port I guess would be either 8080 or 8880 depending on if you want to connect either to Barista or Storefront.

In theory this would connect your Cursive REPL to the REPL already started with the command line.

I can’t try right know, hope this helps

1 Like
#5

Hi @yanisurbis,

You can run your program from Cursive, you just need to create a ‘Run configuration’ based on deps:

You can set the dev alias in Aliases.

2 Likes