Getting JavaScript working in SQLcl in 2025 is not straightforward. Here is how I did it on macOS using GraalVM.
With two lines in your zsh config file, Oracle SQLcl will still work after an upgrade with Homebrew.