6
5

More than 5 years have passed since last update.

leiningenでjarファイル作成のメモ

Last updated at Posted at 2014-10-08
$ lein new sample
src/sample/core.clj
(ns sample.core
  (:gen-class))  ;追加
project.clj
(defproject sample "0.1.0-SNAPSHOT"
  :profiles {:uberjar {:main sample.core, :aot :all}}  ;追加
  )

leingen1.3.0から、「:main sample.core」と指定するだけでは警告がでるようになった。

$ lein uberjar  #target/にjarファイルが作成される
$ java -jar target/sample-0.1.0-SNAPSHOT-standalone.jar  #実行

上記のスタンドアロンファイルには依存ファイルが全て含まれているので、JVM環境下ならどこでも実行可能。

6
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
6
5