Open lgarrido opened 4 years ago
After fiddling a bit, I found out that creating a JFrame (just create it, no need to display it) lets Libjitsi.start() proceed and everything works as it is supposed to.
Just add this somewhere in main():
JFrame frame = new JFrame();
My hypothesis is that creating a JFrame is enough to start up a Cocoa event loop and that satisfies whatever macOS native API Libjitsi is using that complains about the main thread.
Placing it after Libjitsi.start() works too, but probably there is some kind of thread race involved, so it might fail on a faster machine.
Description
I made a very simple, "Hello world" kind of project to get a list of the video devices in a MacBook Pro (MacOS 10.13.6 High Sierra).
The call to LibJitsi.start() won't return and the application must be killed.
However, the same project works as expected in Linux.
It is a Maven project fetching libjitsi 1.0-25-g836ce9e7 from https://github.com/jitsi/jitsi-maven-repository, here are the relevant snippets from pom.xml:
The code is just an App.class with the following main() method:
Current behavior
This is the end of the application output up to the moment it freezes. Before that, it is Libjitsi just reporting stuff and warning about not finding OSGi, it doesn't seem relevant to the issue but I can copy it here if necessary:
Expected Behavior
The application should list the available video devices. It works as expected in Linux.
Environment details
macOS 10.13.6 High Sierra Oracle Java SDK 9.0.4