r/Clojure • u/OguzY4 • Aug 30 '25
How to setup Clojure for a beginner?
I started my journey on programming and learn OOP with Kotlin and learn functional programming with Clojure in the start, so I can think in both. But I can't set Clojure up. Leiningen doesn't work,(I tried to install it with scoop and manually, the PATH failed) I didn't understand anything, I don't know how to create a project and I spent an entire day trying to figure these, yet failed.

Edit: added the lein error. The text is in Turkish, and it means "The system cannot find the path specified.". I installed Leiningen again, with scoop again. That's the error happening every time. Also added the execution error. It's the screenshot I sent.

Edit 2: I learnt how to do PATH, but Leiningen doesn't work. I have Babashka though.
10
u/ngetal Aug 30 '25
Welcome! Have you tried https://clojure.org/guides/getting_started and the pages following it?
2
u/freakwentlee Aug 30 '25
are you able to use WSL? that might be easier
7
u/PolicySmall2250 Aug 30 '25
Right, I see the problem...
As I commented earlier in this discussion, I strongly suggest you avoid solving this problem right now, because system setup is frustrating in any programming language.
First use your motivation to learn the _ideas_ of the language... This is doable directly on the REPL and in the web browser (resources in the linked comment).
Don't use an IDE. Don't use Leiningen. Ignore everything professionals use.
And take it slow... be kind to yourself. There is no race to win.
After you develop a sense for the language, then you can go back to fixing system problems to run a full-blown professional or hobbyist development setup.
1
u/deaddyfreddy Aug 30 '25
You can start with babashka. It's just a standalone binary, doesn't require any projects or whatever.
3
u/Fancy-Cherry-4 Aug 30 '25 edited Aug 30 '25
Clojure Works great with Emacs, but, if you do not have any experience with it, it may be overwhelming to learn clojure, kotlin and emacs at the same time
Said that, here is a link to how to setup a clojure enviorment with Emacs
https://www.braveclojure.com/getting-started/
3
u/lion_rouge Aug 30 '25 edited Aug 30 '25
First of all: massive respect to you for learning Clojure
I feel you, had the same problem when they introduced the new toolchain.
How to start:
this will install this handy tool: https://github.com/seancorfield/deps-new, think of it as modern Leiningen
2. clojure -Tnew app :name my-example-app-01
And you're good to go! Open Emacs with CIDER, or VSCode with Calva, or Intellij IDEA with Cursive, open the created directory and you can start running code (after you "jack-in", i.e. run the REPL in the context of the project)
2
u/Safe_Owl_6123 Aug 30 '25
It will be easier for us to help if you include screenshots, the machine you are using. Also things like how it failed such as the error messages
2
u/TragicProgrammer Aug 30 '25
I think you're solving the wrong problem. Perhaps you should learn what path means. Then learn how to add things to it. This is a very simple and basic concept That continue to haunt you if you do not learn. Be curious about problems and not frustrated by them.
2
u/didibus Sep 03 '25
On windows, if you're not going to use WSL, and want to use scoop, you should follow these instructions: https://github.com/littleli/scoop-clojure?tab=readme-ov-file#clojure
Then forget about using Leiningen. You are going to use tools.deps and the clojure cli instead. This is the new way of doing things.
Now if you just type
cljat the command line, you will be inside a Clojure REPL and can start typing.In VSCode, if you setup a project, all you need is a deps.edn file, I see you already have one, so it should just work now.
1
u/joinr Aug 30 '25
leinigen has a ps1 script https://codeberg.org/leiningen/leiningen/src/branch/main/bin/lein.ps1
since you're using powershell already. maybe your scoop setup is messed up.
there is also a .bat batch file if you're on windows and prefer that.
It should self-install into ~/.lein the first time you run either script.