Fork me on GitHub
#depstar
<
2021-06-10
>
adamtait22:06:23

Hi friends! I’m new to depstar and having a bit of trouble building a library jar file. I get a FileNotFoundException and neither the message or trace are helping to narrow down the possibilities. Repo: https://github.com/6pages/datomic-utils

> clojure -X:jar :jar MyLib.jar
Execution error (FileNotFoundException) at java.io.FileInputStream/open0 (FileInputStream.java:-2).
-X:jar (No such file or directory)
Full exception:
{:clojure.main/message
 "Execution error (FileNotFoundException) at java.io.FileInputStream/open0 (FileInputStream.java:-2).\n-X:jar (No such file or directory)\n",
 :clojure.main/triage
 {:clojure.error/class java.io.FileNotFoundException,
  :clojure.error/line -2,
  :clojure.error/cause "-X:jar (No such file or directory)",
  :clojure.error/symbol java.io.FileInputStream/open0,
  :clojure.error/source "FileInputStream.java",
  :clojure.error/phase :execution},
 :clojure.main/trace
 {:via
  [{:type java.io.FileNotFoundException,
    :message "-X:jar (No such file or directory)",
    :at [java.io.FileInputStream open0 "FileInputStream.java" -2]}],
  :trace
  [[java.io.FileInputStream open0 "FileInputStream.java" -2]
   [java.io.FileInputStream open "FileInputStream.java" 213]
   [java.io.FileInputStream <init> "FileInputStream.java" 155]
   [java.io.FileInputStream <init> "FileInputStream.java" 110]
   [clojure.lang.Compiler loadFile "Compiler.java" 7571]
   [clojure.main$load_script invokeStatic "main.clj" 475]
   [clojure.main$script_opt invokeStatic "main.clj" 535]
   [clojure.main$script_opt invoke "main.clj" 530]
   [clojure.main$main invokeStatic "main.clj" 664]
   [clojure.main$main doInvoke "main.clj" 616]
   [clojure.lang.RestFn applyTo "RestFn.java" 137]
   [clojure.lang.Var applyTo "Var.java" 705]
   [clojure.main main "main.java" 40]],
  :cause "-X:jar (No such file or directory)"}}
Any ideas or pointers would be much appreciated :)

seancorfield23:06:14

@adamtait Your clojure CLI is too old. Run clojure -Sdescribe to see what version you have installed.

seancorfield23:06:07

Per the depstar README: > Note: these instructions assume you have at least version 1.10.1.727 of the Clojure CLI installed. See Clojure Tools Releases for details about the functionality in recent CLI releases. https://clojure.org/releases/tools is the link for Clojure Tools Releases

seancorfield23:06:55

The current stable version is 1.10.3.855. Support for -X was added back in October last year.

seancorfield23:06:43

The symptom is -X:jar (No such file or directory) — which says the clojure script tried to run the first argument (as a Clojure script) because it didn’t recognize it as an option. The stacktrace shows this error is not coming from depstar.

adamtait23:06:14

Thanks much! Upgrading clojure CLI did the trick. Somehow I read that but didn’t think I might have an old version.

seancorfield23:06:22

(I’m currently testing 1.10.3.875 which is a prerelease with the new multi-exec function support that Alex talked about at clojureD last week 🙂 )

clojure-spin 3
👍 3