AdoptOpenJDK / AdoptOpenJDK/IcedTea-Web
WebStart and SWT on macOS
- Dominant language
- Java
- Stars
- 268
- Forks
- 96
- PR merge metrics
- No merged PRs in 30d
Description
Hello community. I have an issue with launching my app on macOS with WebStart. It uses SWT framework which requires "-XstartOnFirstThread" VM argument when running on macOS. At the same time the application works fine if running directly, so the issue seems in the WebStart. Last time SWT and WebStart were working fine on Java 8 prior to macOS Big Sur 11.0.1.
I am using OpenWebStart 1.4.0 with built-in IcedTeaWeb 1.8.6, Adopt OpenJDK 11.0.13/17.0.35 and macOS Monterey 12.0.1
Here is a small SWT jnlp app to easily reproduce the issue. Issue is only presented on macOS. (zipped jnlp)
[test.zip](https://github.com/AdoptOpenJDK/IcedTea-Web/files/7604335/test.zip)
The jnlp sources are in the repo: https://github.com/torchwood1715/swt-test/tree/main/jnlp
The issue is that IcedTeaWeb stucks on startup even before the application code is run. Here is thread-dump:
[threadDump.txt](https://github.com/AdoptOpenJDK/IcedTea-Web/files/7604353/threadDump.txt) and OpenWebStart logs from IcedTeaWeb [2021-11-25_185058.805-ows-stage1.log](https://github.com/AdoptOpenJDK/IcedTea-Web/files/7604356/2021-11-25_18.50.58.805-ows-stage1.log) , [2021-11-25_185058.805-ows-stage2.log](https://github.com/AdoptOpenJDK/IcedTea-Web/files/7604357/2021-11-25_18.50.58.805-ows-stage2.log).
It looks like AWT initialization hangs if -XstartOnFirstThread parameter is used. It is possible to bypass this by using -Djava.awt.headless parameter. But then SWT fails with InvalidThreadAccess exeption, which means -XstartOnFirstThread parameter is not completely honored, and the application was started in not main thread. Does anyone have idea how to fix this?
Contributor guide
Assessment
This issue has not been assessed yet.