Leinをclojureで使用する方法を理解し、Win7x64に正しい.jarファイルをダウンロードする方法を理解しようとしています。具体的な例として、JFreeChartとDejcartesを使おうとしています。
私の質問は一般的なものであり、JfreeChartに固有のものではありません。私は基本的に、特定のパッケージを使用する例を見るのと、そのパッケージをlein経由で利用できるようにするのとの間のギャップを埋める方法を理解していません。うまくいけば、誰かが他のパッケージにも適用できる方法で答えることができます。
次のリンクを参照してください:https ://github.com/markmfredrickson/dejcartes/blob/master/Readme.txt 私のproject.cljは次のようになっています(この投稿の最後の2行をコメントアウトしています)。
(defproject monty "1.0.0-SNAPSHOT"
:description "Monty Game Challenge"
:dependencies [[org.clojure/clojure "1.2.1"]
[org.clojure/clojure-contrib "1.2.0"]
;[org.jfree/chart "1.0.13"]])
[com.markmfredrickson/dejcartes "1.0.0"]])
Dejcartes
(import '(org.jfree.chart chartframe))
のreadme.txtで使用されているので、JFreeChart用の.jarファイルが必要だと思います。[org.jfree/chart "1.0.13"]
project.cljを入力しましたが、lein deps
次のように文句を言います。C:\Users\me\code\Clojure\monty>lein deps Downloading: org/jfree/chart/1.0.13/chart-1.0.13.pom from central Downloading: org/jfree/chart/1.0.13/chart-1.0.13.pom from clojure Downloading: org/jfree/chart/1.0.13/chart-1.0.13.pom from clojars Downloading: org/jfree/chart/1.0.13/chart-1.0.13.pom from central Downloading: org/jfree/chart/1.0.13/chart-1.0.13.jar from central Downloading: org/jfree/chart/1.0.13/chart-1.0.13.jar from clojure Downloading: org/jfree/chart/1.0.13/chart-1.0.13.jar from clojars Downloading: org/jfree/chart/1.0.13/chart-1.0.13.jar from central An error has occurred while processing the Maven artifact tasks. Diagnosis: Unable to resolve artifact: Missing: ---------- 1) org.jfree:chart:jar:1.0.13 Try downloading the file manually from the project website.
.jarファイルを直接ダウンロードする必要があると思いますが、.jarファイルを取得したら、それをクラスパスに配置するようにleinを誘導して、emacsなどを使用してlein swankできるようにするにはどうすればよいですか?
Dejcartesの例では使用しているので、project.clj
(require '[com.markmfredrickson.dejcartes :as chart])
に入れます。[com.markmfredrickson/dejcartes "1.0.0"]
これは、実行するとダウンロードを開始するように見えますlein deps
が、同じようにチョークします。C:\Users\me\code\Clojure\monty>lein deps Downloading: com/markmfredrickson/dejcartes/1.0.0/dejcartes-1.0.0.pom from central Downloading: com/markmfredrickson/dejcartes/1.0.0/dejcartes-1.0.0.pom from clojure Downloading: com/markmfredrickson/dejcartes/1.0.0/dejcartes-1.0.0.pom from clojars Downloading: com/markmfredrickson/dejcartes/1.0.0/dejcartes-1.0.0.pom from central Downloading: com/markmfredrickson/dejcartes/1.0.0/dejcartes-1.0.0.jar from central Downloading: com/markmfredrickson/dejcartes/1.0.0/dejcartes-1.0.0.jar from clojure Downloading: com/markmfredrickson/dejcartes/1.0.0/dejcartes-1.0.0.jar from clojars Downloading: com/markmfredrickson/dejcartes/1.0.0/dejcartes-1.0.0.jar from central An error has occurred while processing the Maven artifact tasks. Diagnosis: Unable to resolve artifact: Missing: ---------- 1) com.markmfredrickson:dejcartes:jar:1.0.0 Try downloading the file manually from the project website.
(clojars)からダウンロードしているとされるリポジトリの1つには、大きなリストにDejcartesが表示されていません。LeinにDejcartesをダウンロードさせるにはどうすればよいですか?
最後に、パッケージの使用を開始したい場合、leinに最新バージョンを自動的に検索させるにはどうすればよいですか?これについては何も見ていません。すべてのproject.cljの例は、バージョンをハードコーディングしているようです
"1.0.2"
。
どうもありがとう
マイケル