Fork me on GitHub
#cursive
<
2024-01-30
>
Yuhrão17:01:30

Hi everyone. Hope you're all doing great! I'm having problems with Cursive when starting REPL... I"m getting a java.lang.IllegalArgumentException: /work/collage/image-processor/src/java/stylitics/StyliticsMagick.class is not a relative path I've tried: • Different Java versions (21 and 11) • Run lein clean, clear maven (`~/m2`) and /target folders • Clear my ~/.lein/profiles.clj • Fresh start (deleted the whole thing and cloned it again) Nothing has worked 'till now Environment: • Mac M2 (MacOS Sonoma 14.3) • IntelliJ IDEA Ultimate • Cursive with an active license Project: • Leiningen project at the root /work/collage • Some subprojects (the one that's causing problems is image-processor) Can someone help me with that? Thank you in advance

cfleming19:01:33

Do you get the same error running lein repl on the command line, e.g. in the IntelliJ terminal?

Yuhrão19:01:35

Nope. It has worked in terminal

cfleming20:01:04

Do you get a full stacktrace in your log? Help | Show log in Finder/Explorer.

👀 1
Yuhrão20:01:28

here it is

cfleming20:01:09

Are you able to share your project.clj? If you’d prefer, you can mail it to me at <mailto:[email protected]|[email protected]>. Otherwise, what do the java-related parts look like? java-source-paths etc.

Yuhrão20:01:19

Here's the java-source-paths . That's only java related stuff

:java-source-paths ["image-processor/src/java"
                      "components/bigquery/src/java"
                      "stylitics/services/shop_the_image_matcher/"]

cfleming20:01:04

In this case, isn’t image-processor a sub-project? Shouldn’t that subproject just have src/java as its java-source paths?

cfleming20:01:23

(not really sure what’s going on, just trying to think it through)

Yuhrão20:01:26

I have those in the same repo under /image-processor . I found that weird because I'm not being able to reproduce it in a isolated project

cfleming20:01:59

So in your root project.clj, you have image-processor/src/java, and in your image-processor project.clj you have src/java? Does it help if you remove the one in the root project?

Yuhrão21:01:09

Yep, but it should not interfere since I'm pointing to my root project.clj is that right? :thinking_face: Because lein should be seeing those paths as part of the same project.

Yuhrão21:01:42

here's my project tree simplified:

.
├── image-processor
│   ├── bin
│   │   └── docker-enter.sh
│   ├── src
│   │   ├── clj
│   │   └── java
│   │       └── stylitics
│   │           ├── ImageMagick.java
│   │           ├── MagickVersion.java
│   │           ├── PNGquant.java
│   │           └── StyliticsMagick.java
│   ├── .gitignore
│   ├── Dockerfile
│   ├── project.clj
│   └── README.md
├
├── resources
├── src
│   ├── c
│   └── clj
├── test
│   └── clj
├── project.clj
└── README.md

Yuhrão21:01:05

I also tried to enable Resolve over whole project but didn't work

cfleming22:01:55

I’m not sure, you’re getting to the edges of my lein knowledge now, sorry. When you run the REPL, are you running it in the context of your root project or the sub-project?

cfleming22:01:07

Resolve over whole project won’t help with this.

Yuhrão23:01:03

I'm running in the context of my root project

cfleming23:01:19

Which version of lein are you using?

cfleming01:01:05

Actually, don’t worry about the version, the most recent version lines up with the stacktrace. So I can see what’s going on, but I don’t know why. I’ll have to see if I can reproduce this.

1
cfleming01:02:47

BTW one thing I forgot to mention - the standard workaround in these cases is to run the REPL on the command line, and then connect to it using a Remote REPL from Cursive, like this: https://cursive-ide.com/userguide/repl.html#remote-repls

1
cfleming01:02:16

That way you at least will have a working REPL until we figure this out.

1
markaddleman21:01:23

fyi, I’m seeing this exception under the latest EAP

cfleming22:01:41

I’ll check, thanks, probably an API has changed, they like to tinker with those ones.