oyvindberg / tui-scala

Beautiful Text-based User Interfaces for Scala
MIT License
207 stars 11 forks source link

Running examples on a fresh clone throws an error #35

Closed ckipp01 closed 1 year ago

ckipp01 commented 1 year ago

Hello! I was just trying to give this a little try and I figured I'd run the demo. Following the instructions I made sure I'm on a new JVM:

❯ java --version
openjdk 17.0.5 2022-10-18
OpenJDK Runtime Environment Temurin-17.0.5+8 (build 17.0.5+8)
OpenJDK 64-Bit Server VM Temurin-17.0.5+8 (build 17.0.5+8, mixed mode, sharing)

And then running the examples gives me the following:

❯ bleep run demo@jvm213 demo
📗 Launching Bleep version 0.0.1-M24 as requested in /Users/ckipp/Documents/scala-workspace/tui-scala/bleep.yaml
📗 bootstrapped in 13 ms
📙 BSP: tui@jvm213 parameter value is_extended in method graphemes is never used [location => file:///Users/ckipp/Documents/scala-workspace/tui-scala/tui/src/scala/tui/internal/UnicodeSegmentation.scala:8:29 until 8:49]
📙 BSP: tui@jvm213 implicit numeric widening [location => file:///Users/ckipp/Documents/scala-workspace/tui-scala/tui/src/scala/tui/CrosstermBackend.scala:96:63 until 96:64]
📙 BSP: tui@jvm213 implicit numeric widening [location => file:///Users/ckipp/Documents/scala-workspace/tui-scala/tui/src/scala/tui/CrosstermBackend.scala:96:60 until 96:61]
📙 BSP: tui@jvm213 implicit numeric widening [location => file:///Users/ckipp/Documents/scala-workspace/tui-scala/tui/src/scala/tui/CrosstermBackend.scala:96:57 until 96:58]
📙 BSP: tui@jvm213 implicit numeric widening [location => file:///Users/ckipp/Documents/scala-workspace/tui-scala/tui/src/scala/tui/CrosstermBackend.scala:95:63 until 95:64]
📙 BSP: demo@jvm213 implicit numeric widening [location => file:///Users/ckipp/Documents/scala-workspace/tui-scala/demo/src/scala/tuiexamples/GaugeExample.scala:119:40 until 119:53]
📙 BSP: demo@jvm213 implicit numeric widening [location => file:///Users/ckipp/Documents/scala-workspace/tui-scala/demo/src/scala/tuiexamples/GaugeExample.scala:97:40 until 97:53]
📙 BSP: demo@jvm213 implicit numeric widening [location => file:///Users/ckipp/Documents/scala-workspace/tui-scala/demo/src/scala/tuiexamples/GaugeExample.scala:90:40 until 90:53]
📗 Compilation succeeded
Exception in thread "main" java.lang.UnsatisfiedLinkError: Native library libcrossterm.dylib (/native/x86_64-darwin/libcrossterm.dylib) cannot be found on the classpath.
        at tui.crossterm.NativeLoader.loadPackaged(NativeLoader.java:29)
        at tui.crossterm.NativeLoader.load(NativeLoader.java:11)
        at tui.crossterm.CrosstermJni.<clinit>(CrosstermJni.java:9)
        at tui.withTerminal$.apply(withTerminal.scala:7)
        at tuiexamples.demo.Demo$.main(Demo.scala:12)
        at tuiexamples.Launcher$.$anonfun$Demos$6(Launcher.scala:12)
        at tuiexamples.Launcher$.$anonfun$Demos$6$adapted(Launcher.scala:12)
        at tuiexamples.Launcher$.main(Launcher.scala:31)
        at tuiexamples.Launcher.main(Launcher.scala)
📕 Failed external command 'run' with exit code 1. See log file for exact command```

I see that this using crossterm under the hood, but do I need to manually make sure that some extra stuff is installed that maybe isn't mentioned in the readme?

oyvindberg commented 1 year ago

Did you run bleep gen-jni-library?

I'll have it set up as a resource generator soon, but for now it's a manual step :)

ckipp01 commented 1 year ago

Ahh, that did the trick. Thanks! I went ahead and shot in #36 to add a small note about this.