Fork me on GitHub

I'm guessing this is fairly simple to solve, but I've got an existing project that doesn't have a JDK configured. I'm not sure how to configure it after a project is already loaded into IntelliJ. In fact, I only seem to get an option to choose a JDK when creating a new project. The docs show an "import" option, but if I delete the .idea directory and Open the project, there's no prompt for what kind of project it is or anything. Just loads it up as, what I can see, a fairly normal leiningen project, but then complains that REPL can't be launched on a right click of project.clj because a JDK runtime could not be found. So yeah, where in the preferences can I set the project's JDK?


IntelliJ is a bit huge, eh? Even the attempts to explain where to find things fall short. But their own doc may show how to get to the JDK: Happy hunting. 🙂 Ah, half way down on the right "Set up the project JDK". hth


Thank you. File -> Project Structure. Wasn't in settings at all


btw, @U0KLE4WHZ, the way I start using I/J initially with a given existing project is "File>New>Project from existing sources". I can do that safely with a project already being worked. At the end it will ask if you want to overwrite any existing .idea. Just confirm. You are right, btw, "Open" just opens the directory for editing.

thanks3 1

worth reading that whole user guide! it's written very concisely, but yet in enough detail, to get a solid understanding of all of Cursive's capabilities. definitely worth the time reading it!


I recently learned about git worktree and would love to use this ability to have different branches of a project checked out at the same time. However, it seems a manual hassle to set up the new project, run configuration etc in Cursive. Is there a good solution for this?


i'd very interested in something like this, because it's quite a hassle to switch between branches and constantly stashing/shelving changes. i would much prefer to just have just duplicate source trees checked out, but there should be some good way to distinguish them when opened in parallel and that should probably be a IDE-level feature, which doesn't exist IMHO


I'm not sure what the answer to this is, I'll have to investigate git worktree.


It seems like this would probably have to be supported by IntelliJ's git support, but there's not much out there, basically this:


Is there anything Cursive-specific you would want from this, or is it more of an IntelliJ question?


I guess it’s more of an IntelliJ question, but I’d love for the Cursive stuff to work as well. I don’t care about IntelliJ’s git support in this regard. What I envision is this: I’m working on feature A and I’m spinning up the environment. Someone asks me about feature b. I create a worktree, check out their branch, look at their code (in Cursive), answer their question, delete the worktree, and start using Cursive for feature A, which is now done spinning up. The problem, as I see it, is not git support. I do my git stuff elsewhere. It’s the setting up of the project files, REPL and other project specific stuff to do with IntelliJ/Cursive, that I want to avoid having to do every time I do git worktree add ./temporary.


I know git worktree is probably not widely used, so I didn’t expect any specific support for it 🙂 I was just hoping that there was! 😄


I read a different thread where Dmitriy Smirnov, one of the IntelliJ maintainers, said that you could commit the idea project files. I don’t like that for this project at work, lots of different people working on it, and I’d like the project to be free of cruft like that. But I get the idea (heh)


Alternative; git worktree add ./alternate and then never remove it. Set up project files once, then reuse it every time I want to do some temporary stuff. I figure that might work for most of my use cases. It’s nowhere near as limber as I’d hoped for, but I can still git worktree add ./another when I don’t need to use IntelliJ, e.g. when I just need to read something as plaintext in nvim or less or whatever.


Maybe there’s some easy, git-worktree-unrelated way to copy idea files and have them “just work”™ under a different folder? (tbh I haven’t even tried just copying them, yet 😅 )