Fork me on GitHub
#biff
<
2023-01-22
>
parenbot15:01:38

Hello, a newbie here. Trying to set up Biff. I keep getting this error.

----- Error --------------------------------------------------------------------
Type:     java.lang.IllegalArgumentException
Message:  No matching method exit found taking 2 args
Location: <expr>:73:5

----- Context ------------------------------------------------------------------
69:     (System/exit 1 exit-code)))
70: 
71: (defn -main [& [branch]]
72:   (when-not (have-java-11?)
73:     (die "Please install Java 11 or higher."))
        ^--- No matching method exit found taking 2 args
74:   (when-not (fs/which "curl")
75:     (die "`curl` command not found. Please install it. (`scoop install curl` on Windows.)"))
76:   (let [ref->commit (fetch-refs)
77:         commit (if-not branch
78:                  (ref->commit "HEAD")

----- Stack trace --------------------------------------------------------------
com.biffweb.new-project/die - <expr>:66:1
com.biffweb.new-project     - <expr>:73:5
clojure.core/apply          - <built-in>
com.biffweb.new-project     - <expr>:138:1

parenbot15:01:39

This is my java version

$ java -version
openjdk version "19.0.1" 2022-10-18
OpenJDK Runtime Environment (build 19.0.1+10-Ubuntu-1ubuntu122.04)
OpenJDK 64-Bit Server VM (build 19.0.1+10-Ubuntu-1ubuntu122.04, mixed mode, sharing)

parenbot15:01:22

I'm running this command

bb -e "$(curl -s )"

parenbot15:01:47

which bb
/usr/local/bin/bb

parenbot15:01:16

I'm Running Ubuntu 22

parenbot16:01:52

$ bb --version
babashka v1.0.169

pavlosmelissinos16:01:10

Hm, that's newer than mine (1.0.166) but I can't reproduce with the newest one (1.0.170) either. I don't think that's it but can you upgrade babashka and try again?

Jacob O'Bryant17:01:46

that java 11 check is more trouble than it's worth. I thought I fixed the flakiness but I guess there are still edge cases. I removed the check (and also fixed the sloppy error in the die function...). If you run bb -e "$(curl -s )" again it should work now.

parenbot17:01:13

$ bb -e "$(curl -s )"
Enter name for project directory: trifecta
Enter main namespace (e.g. com.example): com.siq.trifecta


Your project is ready. Run the following commands to get started:

  cd trifecta
  git init
  bb dev

And run `bb tasks` for a list of available commands.

🎉 4
parenbot17:01:35

This looks like it works now. Thank you.

👍 2
pavlosmelissinos17:01:54

https://clojurians.slack.com/archives/C013Y4VG20J/p1674406846118229?thread_ts=1674401978.226749&amp;cid=C013Y4VG20J > that java 11 check is more trouble than it's worth Why is Java 11 required btw? Maybe the installer could test directly for the actual feature that it depends on (that is, unless you've definitely decided to get rid of the check)?

Jacob O'Bryant17:01:18

it's because recent versions of Jetty don't support Java 8 anymore (there's a note about it here, which is the Jetty adapter that biff uses: https://github.com/sunng87/ring-jetty9-adapter)

Jacob O'Bryant17:01:19

I think most people are on at least Java 11 now anyway; I doubt the check is doing much good in the first place. the getting started docs do mention the Java 11 requirement at least.

👍 2
pavlosmelissinos17:01:02

Oh, I see! Yeah, it makes perfect sense to drop it then 🙂

parenbot17:01:54

@pavlos @foo Would you be kind to help me with this?

$ bb dev
Cloning: 
Checking out:  at b3027b91cc208ea40f20d8c5b48d67ea2daf9d94
Downloading the latest version of Tailwind CSS...
After it finishes, you can avoid downloading Tailwind again for future projects if you copy it to your path, e.g. by running:
  sudo cp bin/tailwindcss /usr/local/bin/

parenbot17:01:35

Looks like I have to run it with sudo

parenbot17:01:58

But Why do I have to do use sudo

pavlosmelissinos17:01:21

it's because bb is not under your home directory

parenbot17:01:58

Shit, thank you, let me re install the whole setup!

pavlosmelissinos17:01:49

Check this out: https://github.com/babashka/babashka#installer-script > By default this will install into /usr/local/bin (you may need sudo for this). To change this, provide the directory name:

$ ./install --dir .

parenbot17:01:07

Thanks even more.

Jacob O'Bryant17:01:10

that part is totally optional too. when you start a new biff project for the first time it'll download tailwind into the project folder. if you make more projects in the future, it'll download tailwind each time. this is just saying that if you want to avoid downloading tailwind multiple times for multiple projects, you can install it to your system somewhere.

👍 2
Jacob O'Bryant17:01:27

the message is unrelated to babashka, no need to install that again

facepalm 2
parenbot17:01:39

Ok? Let me try that!

👌 2
Jacob O'Bryant17:01:39

in the example command, sudo is where because /usr/local/bin is a system folder, so you can't copy stuff to it unless you use sudo

parenbot18:01:54

👍 can't wait to start the documentation.

parenbot18:01:22

I presume this is normal

parenbot18:01:25

[qtp156461227-46] INFO com.biffweb.impl.middleware -   3ms 200 get  /img/glider.png
Click here to sign in as : 

Jacob O'Bryant19:01:47

yep, that's the normal flow. you're welcome!