'How to setup clojure.main?
In reference to the thread here : Clojurescript: Error: Could not find or load main class clojure.main
Where (in which directory) do we need to keep the clojure.jar? Should it be in the lein folder or in the folder where lein folder exists?
I am trying Clojure for the first time and have already spent a large amount of time in setting up Clojure and lein. But still facing the same error.
Solution 1:[1]
Open a project with lein
$ lein new myproject
$ cd myproject
There in src/<projectname>/core.clj
put your code - and from inside this myproject folder
start lein:
lein repl
It will run the core.clj code - and say sth like:
nREPL server started on port 46297 on host 127.0.0.1 - nrepl://127.0.0.1:46297
So you can connect with this repl from emacs using
M-x cider-connect and choose localhost and as port 46297 or whatever is given as port in that nREPL line!
Solution 2:[2]
Please see this template project for a good way to get started
Follow the instructions in the README file. An excerpt:
How to Use This Project
To use this project, we assume you have already installed Java, Clojure, and Leiningen, and git.
Clone the Project Using Git.
Verify you have Git installed:
> git --version
git version 2.25.0
Use git to clone the project (via SSH) into a new project names demo:
> git clone [email protected]:io-tupelo/clj-template.git demo # git ssh URL
or, clone via HTTPS (if you don’t have SSH set up on your computer & GitHub):
> git clone https://github.com/io-tupelo/clj-template.git demo # git https URL
Then cd (change directory) into the new project:
> cd demo
Verify you have Java, Clojure, and Leiningen set up correctly
Try the following commands, and make sure you get similar output:
> java --version
java 13 2019-09-17
Java(TM) SE Runtime Environment (build 13+33)
Java HotSpot(TM) 64-Bit Server VM (build 13+33, mixed mode, sharing)
> lein --version
Leiningen 2.9.1 on Java 13 Java HotSpot(TM) 64-Bit Server VM
....etc....
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Gwang-Jin Kim |
| Solution 2 |
