tools-deps

Richie 2024-08-09T15:01:28.166219Z

I'm trying to follow https://clojure.org/guides/tools_build#_mixed_java_clojure_build. I have some java sources that I got from running jextract and I want to use them in my Clojure code.

Richie 2024-08-09T15:01:43.581909Z

Richie 2024-08-09T15:02:43.062159Z

Richie 2024-08-09T15:04:24.675649Z

Wait, never mind. There actually are class files under /target/classes. They just don't show up in emacs dired mode.

2024-08-09T15:05:44.919239Z

with my emacs setup at least (which i think uses defaults in this regard), dired doesn't automatically refresh the contents, you have to press "g" in the dired buffer to see the latest contents

Richie 2024-08-09T15:07:45.482869Z

I was going to share the folder structure with tree and then I saw all the class files for the first time.

Richie 2024-08-09T15:09:34.877339Z

".class" was in dired-omit-extensions and dired-omit-files I don't think it's a matter of refreshing. I think I'm just fighting emacs. Thanks though.

👍 1
Richie 2024-08-09T15:24:37.766779Z

(remove-hook! 'dired-mode-hook #'dired-omit-mode) fixed it for me

Richie 2024-08-09T15:31:50.343389Z

I'm confused. I have class files in /target/classes. How do I add that to my classpath? I open a repl with cider-jack-in-clj and I want to use the java classes from my repl.

2024-08-09T15:41:46.681369Z

you could just put the class dir in :paths

Richie 2024-08-09T15:42:50.939999Z

Oh.

2024-08-09T15:42:51.787119Z

Or put them in a jar, and put a separate entry in :deps with a :local/root pointing to the jar file

Richie 2024-08-09T15:43:19.102979Z

Ah.

Richie 2024-08-09T15:43:27.516389Z

That's helpful.

Richie 2024-08-09T15:46:58.601139Z

Thank you!

👍 1
Richie 2024-08-14T15:34:15.734869Z

Ah, right. rtm https://clojure.org/guides/deps_and_cli#prep_libs