简体   繁体   中英

install4j: on MacOS installed application doesn't run

My application is installed into the default /Applications directory but double-clicking the icon in /Applications or in Dock only runs the application once or twice and then stops working. Afterwards, it only displays the application title in the Finder bar and nothing else. The application then has to be force quit because it's unresponsive. Occasionally, it works from the /Applications directory, but never from the Dock.

At the same time, when I run it manually as /Applications/application_name.app/Contents/MacOS/JavaApplicationStub , it always launches correctly.

Am I missing something in the installation process or is this a bug? Has anyone seen this behavior before? Is there a way to diagnose the issue?

I use install4j version 7.0.12 and MacOS Mojave (10.14.5).

Thank you!

Sasha

GUI applications on macOS are always single instance, they are not started again when you click the dock icon for a second time. In that case, the application is simply activated. There is an API in install4j for reacting to this condition, see

https://www.ej-technologies.com/resources/install4j/help/api/com/install4j/api/launcher/StartupNotification.html

for more information.

The main GUI thread on MacOS was trying to open simultaneously the main application window and the login dialog as a separate frame (Stage). It worked only occasionally, which indicated a thread-related problem.

My workaround was to change the code to display the login fields in a panel of the main window instead of starting a new dialog. This fixed the problem.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM