Can clojure.java.io/resource load a file from pathpath, but outside the jar file? When I put the file in the jar file, it loads the file, but when I put the file outside the jar, but in the classpath it does not load the file.
Example
Jar name: hello.jar Inside the jar there is a hello.txt file
java -jar hello.jar
I did not see a problem reading the hello.txt file using the line below
(->
"hello.txt"
(clojure.java.io/resource)
(clojure.java.io/file)
(slurp))
But when I put hello.txt outside the jar, but in the classpath, it cannot load the file.
java -cp . -jar hello.jar
hello.txt file in the same directory as the hello.jar file.
Br, Mamun
Mamun source
share