This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-01-12
Channels
- # announcements (1)
- # babashka (32)
- # beginners (27)
- # calva (4)
- # clojure (18)
- # clojure-australia (2)
- # clojure-europe (11)
- # clojure-spec (8)
- # clojure-uk (15)
- # clojurescript (8)
- # cursive (14)
- # datomic (12)
- # fulcro (36)
- # graalvm (3)
- # graphql (2)
- # jobs (1)
- # meander (1)
- # pathom (5)
- # pedestal (12)
- # re-frame (1)
- # reagent (1)
- # reitit (2)
- # testing (12)
- # vim (2)
Edit: solved 😄
Hello, I have a question around repl set up in intellij with the cursive plugin.
I used the lein new app app_name
command, and can run the app from my terminal. I haven’t changed anything at all in the scaffolded app.
When I try to run the repl, I get
Error: Could not find or load main class clojure.main
Caused by: java.lang.ClassNotFoundException: clojure.main
and all the function names are highlighted as not resolved. Any idea what might be causing that?
short answer: yes
long answer - here is my project.clj
(defproject comparer "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url ""
:license {:name "EPL-2.0 OR GPL-2.0-or-later WITH Classpath-exception-2.0"
:url " "}
:dependencies [[org.clojure/clojure "1.10.1"]]
:main ^:skip-aot comparer.core
:target-path "target/%s"
:profiles {:uberjar {:aot :all
:jvm-opts ["-Dclojure.compiler.direct-linking=true"]}})
What I always do when creating a new leiningen project is create it at the command line like you did, and then in IntelliJ, select File -> New -> Project From Existing Sources. That registers the project as a Leiningen project and loads all the dependencies, etc. If you didn’t do that, that might be why it’s giving you problems.

I will try that now!
actually, just looking at the file tab, there was an option to add it as leiningen project, and that did the trick!
thank you!
if I want to do web developement in clojure as soon as i finished the brave book, can I then better make a leiningen or a clojure-clj project ?
I personally just use clj and shadow-cljs. But getting familiar with leinigen is beneficial. Also for web dev have a look at: https://luminusweb.com/ And consider reading: https://www.amazon.com/Web-Development-Clojure-Build-Bulletproof/dp/1680500821
Here's a small (server-side) web app that uses the Clojure CLI and deps.edn
: https://github.com/seancorfield/usermanager-example -- I would suggest making sure you understand how this works and that you can modify and enhance it yourself before trying to work with Luminus (or the Web Development book). Luminus is a lot of moving parts and uses a lot of different libraries. It's a huge step up from what you're currently working with in Brave&True.
My ideea was to start very small. A app with 3 routes and some json parsing and hiccup
and no problem to start this app very small. As I look at it Luminus seems to be overkill for this app
When I evaluate a line referencing a function, after changes were made to that function, those changes aren't being reflected when evaluating the line. Evaluating that function and then evaluating the line referencing it shows the changes. Why is that?
Yeah, so say I have a function that adds 2
to a provided number, then I realize it should be adding 3
. I'll change that number to 3
inside of the function, evaluate a line referencing that function, and it'll still add 2
.
But if I evaluate the function and then evaluate the reference, that change will be reflected.
Cool, thank you! Just taking some getting used to on my part.
If it helps: Clojure is always compiled, even in the REPL, and compilation happens as you evaluate each top-level form. It's a good practice to get into to instinctively "eval top-level block" after every change you make to any function.
Funnily enough, I just gave a talk to the London Clojurians about this very topic... recording to be available soon!
Awesome, that does help! I'll keep an eye out for the recording.