Skip to content

Wrong JPEG library version: library is 80, caller expects 70

Bartosz Firyn edited this page May 31, 2016 · 1 revision

Wrong JPEG library version: library is 80, caller expects 70

This can be reproduced by:

public class Main  extends Application {

  public static void main(String[] args) {
    Webcam.getDefault();
    Application.launch(Main.class, args);
  }

  @Override
  public void start(Stage stage) throws Exception {
    // ...
  }
}

This error is most likely caused by the fact that OpenIMAJ is loading system library libjpeg-8 when JavaFX expects libjpeg-7 which is bundled with the JRE.

The solution is to initialize your JavaFX application first and then use Webcam Capture API (just move all your webcam-related code after application is launched).

public class Main  extends Application {

  public static void main(String[] args) {
    Application.launch(Main.class, args);
  }

  @Override
  public void start(Stage stage) throws Exception {
    Webcam.getDefault();
    // ...
  }
}