I packaged a Java console application using jpackage. I can install the app and also run it from the command-line by giving the full path of the executable like:
/Applications/my-app.app/Contents/MacOS/my-app
But when I double-click the app in the Applications folder nothing happens (not even an error). Similarly if I try to launch it from Spotlight, nothing happens.
What can I do so that I can run the application:
- by double-clicking on it in the Applications folder?
- by typing its name in Spotlight?
I am using:
- JDK21
- Mac OS Ventura
Providing some more details: Related Question here. I tried the suggested answer:
In the MacOS folder, right-click on the Terminal icon showing your app's name. Open with Terminal....
This will show you any errors fired during the launch sequence.
In my case there are no errors if I try to run the application using the steps above. It launches normally. In fact, I can launch it by double-clicking on it in the MacOS folder.
I also inspected Utilities->Console in Mac and saw following messages (when I attempt to launch the app by double-clicking on it):
Checking PreventLaunch: global:0 exPath:/Applications/xxx.app/Contents/MacOS/xxx predicates:(null) allow:(null)
-[PersistentAppsSupport applicationReady:] | App: xxx, ready, updating active tracking timer
-[ApplicationManager checkInAppContext:eventData:] | ApplicationManager: Checked in app : xxx
-[PersistentAppsSupport applicationQuit:] | for app:xxx, _appTrackingState = 2
-[PersistentAppsSupport applicationQuit:] | App: xxx, quit, updating active tracking timer
I also tried the steps here with the difference that I created a console app instead of a GUI application and got the same result. You cannot launch the app by double-clicking on it in the Applications folder. Double-clicking the binary under Contents/MacOS works as earlier.
I have also tried opening the app using:
open /Applications/my-app.app
on the command-line. This gives same result as double-clicking the app in Applications folder (does not launch). No output is logged to the command-line.