In the "ClojureScript Compiler" section of the ClojureScript Quick Start 
Guide <>, we run the build 
script with the java command:

java -cp cljs.jar:src clojure.main build.clj

This command starts a JVM and loads the cljs.jar file and all of the 
contents of the 'src' directory, to the JVM Classpath.

According to the man page for the java program, clojure.main is a class 
file, (I'm assuming this one 
and build.clj is its argument.

My question is: *How is the clojure.main class getting loaded to the 

Obviously clojure.main is part of Clojure. By unzipping the cljs.jar, I see 
that it has a project.clj file with the following contents:

(defproject org.clojure/clojurescript "0.0-SNAPSHOT"
  :description "ClojureScript compiler and core runtime library"
  :parent [org.clojure/pom.contrib "0.1.2"]
  :url "";
  :license {:name "Eclipse Public License"
            :url ""}
  :jvm-opts ^:replace ["" "-Xmx512m" 
  :source-paths ["src/main/clojure" "src/main/cljs"]
  :resource-paths ["src/main/cljs"]
  :test-paths ["src/test/clojure" "src/test/cljs" "src/test/self" 
  :dependencies [[org.clojure/clojure "1.8.0"]
                 [org.clojure/data.json "0.2.6"]
                 [org.clojure/tools.reader "1.0.3"]
                 [org.clojure/test.check "0.10.0-alpha2" :scope "test"]
                 [com.cognitect/transit-clj "0.8.300"]
                 [org.mozilla/rhino "1.7R5"]]
  :profiles {:1.6 {:dependencies [[org.clojure/clojure "1.6.0"]]}
             :uberjar {:aot :all :main clojure.main}}
  :aliases {"test-all" ["with-profile" "test,1.5:test,1.6" "test"]
            "check-all" ["with-profile" "1.5:1.6" "check"]}
  :min-lein-version "2.0.0")

[org.clojure/clojure "1.8.0"] is listed as a dependency. Is this how 
Clojure is getting loaded to the JVM Classpath?

If so, how is this happening? It doesn't seem like the java program would 
be smart enough to parse a project.clj file. 

Note that posts from new members are moderated - please be patient with your 
first post.
You received this message because you are subscribed to the Google Groups 
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
To post to this group, send email to
Visit this group at

Reply via email to