From 6ce94bdd86626cd5d3673a48c6fe0a565ca0f9a2 Mon Sep 17 00:00:00 2001 From: Michiel Borkent Date: Thu, 11 Jun 2020 23:04:25 +0200 Subject: [PATCH] [#469] Fix classpath on Windows for .jar files --- src/babashka/impl/classpath.clj | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/babashka/impl/classpath.clj b/src/babashka/impl/classpath.clj index 07d56b28..63b595e7 100644 --- a/src/babashka/impl/classpath.clj +++ b/src/babashka/impl/classpath.clj @@ -62,7 +62,9 @@ (defn source-for-namespace [loader namespace opts] (let [ns-str (name namespace) ^String ns-str (munge ns-str) - base-path (.replace ns-str "." (System/getProperty "file.separator")) + ;; do NOT pick the platform specific file separator here, since that doesn't work for searching in .jar files + ;; (io/file "foo" "bar/baz") does work on Windows, despite the forward slash + base-path (.replace ns-str "." "/") resource-paths (mapv #(str base-path %) [".bb" ".clj" ".cljc"])] (getResource loader resource-paths opts)))