This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-11-21
Channels
- # announcements (1)
- # babashka (66)
- # beginners (37)
- # calva (3)
- # cljdoc (2)
- # clojure (14)
- # clojure-australia (6)
- # clojure-doc (4)
- # clojure-europe (22)
- # clojurescript (9)
- # datalevin (5)
- # datomic (4)
- # emacs (5)
- # events (1)
- # figwheel-main (6)
- # graalvm (41)
- # lsp (16)
- # luminus (1)
- # off-topic (2)
- # overtone (2)
- # re-frame (2)
- # reagent (8)
- # remote-jobs (1)
- # reveal (49)
- # shadow-cljs (9)
- # spacemacs (14)
- # tools-build (4)
- # tools-deps (16)
Idle thought - when is someone going to use the babashka tasks API to implement a build tool and package manager?
I’m working on makejack
which provides build tasks that mostly are capable of running with bb. It includes a standalone bb script , which you can download and run https://github.com/hugoduncan/makejack/blob/main/mj
Still alpha at the moment, but I’m using it one other project.
The project is here https://github.com/hugoduncan/makejack
@U04V15CAJ has updated bb, and together with a tools-deps-native pod, we can run tools.build tasks.
I'm having problem with bb finding 'clojure.main' I installed clojure using brew, and it's located in '/opt/homebrew/bin/clojure'. But when I attempt to run a clojure program using bb (i.e., bb -m foo.main) I get the error 'Could not find or load main class clojure.main' I have clojure as a dependency in my bb.edn file. Thanks in advance for any help in solving this one.
Hi! You don't need clojure as a dependency for babahska. Babashka is a standalone binary. This error message seems to be coming from a JVM, perhaps because babashka is trying to download dependencies for which it uses clojure.
Note that you have to use the clojure tap, not the package from homebrew itself: https://clojure.org/guides/getting_started#_installation_on_mac_via_homebrew
Thanks. It's shows me the help docs. Note I also installed java using brew. opt/homebrew/opt/openjdk/bin
I didn't use the clojure tap though for homebrew. I used the core tap. Let me reinstall
I'm attempting the example from your Project Setup section in the Babashka book. bb -m my-project.main Error: Could not find or load main class clojure.main Caused by: java.lang.ClassNotFoundException: clojure.main
Interesting! That comes back Error: Could not find or load main class clojure.main Caused by: java.lang.ClassNotFoundException: clojure.main. Yet, I'm able to run bb scripts
there might be an error in your bb.edn. I tried the sample project from the book and it worked fine here
Exception in thread "main" java.io.FileNotFoundException: /Users/alexkelley/.clojure/.cpcache/363A78F07197DB7FD0EDF27138B9FAFF.cp (No such file or directory)
Could not find /Users/alexkelley/.deps.clj/1.10.3.1029/ClojureTools/clojure-tools-1.10.3.1029.jar Downloading tools jar from https://download.clojure.org/install/clojure-tools-1.10.3.1029.zip to /Users/alexkelley/.deps.clj/1.10.3.1029/ClojureTools Exception in thread "main" java.io.FileNotFoundException: /Users/alexkelley/.clojure/.cpcache/363A78F07197DB7FD0EDF27138B9FAFF.cp (No such file or directory)
Yes. /Users/alexkelley/.clojure ├── deps.edn └── tools └── tools.edn 1 directory, 2 files
and no file:
/Users/alexkelley/.clojure/.cpcache/363A78F07197DB7FD0EDF27138B9FAFF.cp
or so?openjdk 17.0.1 2021-10-19 OpenJDK Runtime Environment Homebrew (build 17.0.1+0) OpenJDK 64-Bit Server VM Homebrew (build 17.0.1+0, mixed mode, sharing)
I can't reproduce this...
borkdude@MBP2019 /tmp/project $ rm -rf ~/.clojure/.cpcache/
borkdude@MBP2019 /tmp/project $ rm -rf ~/.m2/repository/medley
borkdude@MBP2019 /tmp/project $ java --version
openjdk 17.0.1 2021-10-19
OpenJDK Runtime Environment GraalVM CE 21.3.0 (build 17.0.1+12-jvmci-21.3-b05)
OpenJDK 64-Bit Server VM GraalVM CE 21.3.0 (build 17.0.1+12-jvmci-21.3-b05, mixed mode, sharing)
borkdude@MBP2019 /tmp/project $ bb -m my-project.main
Downloading: medley/medley/1.3.0/medley-1.3.0.pom from clojars
Downloading: medley/medley/1.3.0/medley-1.3.0.jar from clojars
{1 {:id 1}, 2 {:id 2}}
Try this:
$ cp bb.edn deps.edn
$ clojure -M -m my-project.main
{1 {:id 1}, 2 {:id 2}}
tree /Users/alexkelley/.clojure/.cpcache /Users/alexkelley/.clojure/.cpcache ├── 2663883992.basis ├── 2663883992.cp ├── 2663883992.libs ├── 4E9D4371BD0E58D039BDA63A46AF924D.basis ├── 4E9D4371BD0E58D039BDA63A46AF924D.cp └── 4E9D4371BD0E58D039BDA63A46AF924D.libs
tree /Users/alexkelley/.clojure/.cpcache /Users/alexkelley/.clojure/.cpcache ├── 4E9D4371BD0E58D039BDA63A46AF924D.basis ├── 4E9D4371BD0E58D039BDA63A46AF924D.cp └── 4E9D4371BD0E58D039BDA63A46AF924D.libs
Please write up an issue with details from this discussion if you have the time... I'll take a look at reproducing the issue locally. I'm not sure what it is right now