Clojure Uberjar not loading resource file

后端 未结 2 1886
予麋鹿
予麋鹿 2021-01-12 07:23

I use lein uberjar to create a standalone jar of an application.

When executing

java -jar dataloader-0.1.0-SNAPSHOT-standalone.jar,
2条回答
  •  心在旅途
    2021-01-12 07:50

    clojure.java.io/resource returns a URL, not a file. That's why you can call slurp on it. The error message is telling you that it's not a file, unfortunately it's not telling you that it's a URL.

    Of course you could open the url with the java.net.URL api although that would be overkill in this case.

提交回复
热议问题