0

I'm attempting to write a program with jtouchbar, Maven and JavaFX and when I try to run the project with only the boilerplate code they include in the readme, I get an error

Exception in Application start method Caused by: java.lang.UnsatisfiedLinkError: Unable to open /lib/libJTouchBarJavaFX.dylib from jar file.

I went into the file directory to make sure that the file it's looking for is in the right place, and it is.

This is my start() method if its any help

public void start(Stage stage) throws IOException {
    FXMLLoader fxmlLoader = new FXMLLoader(HelloApplication.class.getResource("hello-view.fxml"));
    Scene scene = new Scene(fxmlLoader.load(), 320, 240);
    stage.setTitle("Hello!");
    stage.setScene(scene);
    JTouchBar jTouchBar = new JTouchBar();
    jTouchBar.setCustomizationIdentifier("MyJavaFXJavaTouchBar");
    jTouchBar.addItem(new TouchBarItem(TouchBarItem.NSTouchBarItemIdentifierFlexibleSpace));
    JTouchBarJavaFX.show(jTouchBar, null);
    stage.show();
}

Any idea what I can do to fix this? Thanks in advance

Miles Acq
  • 71
  • 1
  • 9
  • It looks like the last major update was over two years ago. I wonder if it is compatible with the latest version of Java. What Java version are you using? – SedJ601 May 19 '22 at 01:55
  • Also make sure the binary code is built for your execution architecture, either arm or Intel, whichever hardware you run and need to support. – jewelsea May 19 '22 at 07:43
  • I’m not sure why you would use this. I thought that Apple were phasing out the touchbar in future (current?) products. – jewelsea May 19 '22 at 07:44
  • 1
    Please see the comment from the creator -> https://stackoverflow.com/questions/41209625/create-java-applications-with-macbook-pro-touchbar-support/46903994?noredirect=1#comment127733182_46903994 – SedJ601 May 19 '22 at 14:55
  • Sedrick, I've tried Java 17 and 14, and I'm trying 11 now but it doesn't seem to work with the library at all. – Miles Acq May 19 '22 at 16:47
  • Did you put the dylib in the location it is looking? Are you running an incompatible M1 Mac that would be unable to read the dylib. Check your [library path](https://stackoverflow.com/questions/2446426/what-is-the-cause-of-an-unsatisfiedlinkerror). Even then, there is no guarantee an unmaintained library will continue to work against different JDK/OS and hardware versions that it was never developed for. – jewelsea May 19 '22 at 21:26

0 Answers0