Hey guys, I'm new here so please bear with me. I'm creating a boot script with the following content:
#!/usr/bin/boot
(defn -main
[& args]
(println "blah"))
but got this error whenever I try to run it
Boot failed to start:
java.lang.NullPointerException
at boot.main$shebang_QMARK_.invokeStatic(main.clj:114)
at boot.main$shebang_QMARK_.invoke(main.clj:110)
at boot.main$_main.invokeStatic(main.clj:140)
at boot.main$_main.invoke(main.clj:123)
at clojure.lang.Var.invoke(Var.java:394)
at org.projectodd.shimdandy.impl.ClojureRuntimeShimImpl.invoke(ClojureRuntimeShimImpl.java:154)
at org.projectodd.shimdandy.impl.ClojureRuntimeShimImpl.invoke(ClojureRuntimeShimImpl.java:145)
at boot.App.runBoot(App.java:407)
at boot.App.main(App.java:500)
Can someone please tell me what I'm doing wrong with this? Also if I follow the instruction in https://github.com/boot-clj/boot/wiki/Scripts I still have the same issue.I installed Boot via Homebrew, so boot
actually lives in /home/linuxbrew/.linuxbrew/bin/boot
but that should be fine since /usr/bin/env boot
finds the first boot
executable in the PATH
?
fwiw, this worked for me:
#!/usr/local/bin/boot
(defn -main
[& args]
(println "blah"))
maybe my boot executable is just in the wrong place
What does which boot
say?
Because from the output it looks like boot ran.
/home/linuxbrew/.linuxbrew/bin/boot
I'm really new into this whole thing, and googling that error didn't give me any result at all
Uninstall boot and re-install it. Then make a new empty directory, cd into it, and run boot to see what happens.
I'm guessing that (System/getProperty "boot.app.path")
is null here. https://github.com/boot-clj/boot/blob/master/boot/core/src/boot/main.clj#L113-L114
ok so I uninstalled linuxbrew
's boot
and downloaded the executable directly and put it on the PATH
and now it works perfectly fine
o.O
thanks for the suggestion tbl3rd 😄 I can start automating my stuff with clojure now to slowly convert people to clojurists 👀
Welcome to the party!