No :main namespace specified in project.clj

16,685

First is an argument being passed to the main function of the namespace specified in C:\Users\a\project.clj. Did you want C:\Users\a\First\project.clj? If so, cd into that directory first.

Share:
16,685
Zeynel
Author by

Zeynel

I just installed Discourse forum on a home server (with a lot of help from kind folks here and SuperUser).

Updated on June 09, 2022

Comments

  • Zeynel
    Zeynel almost 2 years

    I just started Web Development with Clojure but I am stuck with a real simple problem. I have :main myapp.core/foo in the project.clj

    (defproject myapp "0.1.0-SNAPSHOT"
      :description "FIXME: write description"
      :url "http://example.com/FIXME"
      :license {:name "Eclipse Public License"
                :url "http://www.eclipse.org/legal/epl-v10.html"}
      :dependencies [[org.clojure/clojure "1.5.1"]]
      ;; this will set foo as the main function
      :main myapp.core/foo)
    

    but when I run lein I get this error:

    C:\Users\a>lein run First
    No :main namespace specified in project.clj.
    C:\Users\a>
    

    What am I doing wrong?

  • Zeynel
    Zeynel over 10 years
    Thanks, that was stupid. project.clj was in C:\Users\a\myapp so I cd to that directory. Thanks for answering.