Java – environment variable classpath < > classpath of clojure Why?

Here, I check the environment variable classpath

Here, I examine what Java thinks it is daniel @ daniel-laptop:〜/ ps / clojure / projects / ring-tutorial $lein repl Clojure 1.1. 0 user = > (system / getproperty "Java. Class. Path") "Src /: class / / homepage / Daniel /. M2 directory / library / leiningen / leiningen / 1.1.0 / leiningen-1.1.0-standalone.jar: lib / clojure's - 1.1.0.jar: lib / servlet's API - 2.5-6.1.14.jar: lib / commons - io-1.4.jar: lib / clj - stack trace - 0.1.0.jar: lib / clojure's - contrib-1.1.0.jar: lib / ring devel's - 0.2.0.jar: lib / dock util's - 6.1.14.jar: Li B / CLJ-HTML-0.1. 0.jar: lib / ring dock adapter -0.2 0.jar: lib / Wharf - 6.1 14 Jar: lib / ring core -0.2 0.jar: lib / public file upload - 1.2 1. Jar: lib / ring servlet 0.2 0.jar: lib / public codec - 1.4 jar:”

As you can see, the two reactions are completely different I'm pretty sure I have to misunderstand where I should edit the classpath variable to make Java "get it", except that everything I find says it should work What kind of deal is that? Will lainingen have his own strange traitor rebellion? Am I editing a completely unrelated variable? Any help would be appreciated

Solution

$classpath really doesn't matter here at all If no classpath information is provided on the command line, Java the JVM launcher program will use it; Leiningen provides the JVM with a classpath suitable for any project you are working on

In this special case, "/ home /... / ring tutorial / SRC" is not a very useful classpath for the ring tutorial, because it only contains the source code of the ring tutorial and does not contain clojure jars (which is necessary). For running clojure code, ring jars (ring is a multi module project) or any other jar that ring depends on Leiningen's generated classpath may look long, but all its components need to exist

By the way, if you are just starting to use clojure, I suggest you stick to the classpath management tool of your tool chain (this may mean that Emacs lein swing or some ides are clojure plug-ins), if possible Otherwise, there are a lot of questions about so's clojure classpath problem, and a lot of other resources about topics you can Google... But now the tool support is quite powerful, and you usually don't need to pass it. On the one hand, this is just the pain you'd better avoid at the beginning

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>