LSOpenURLsWithRole() failed with error -10810 - Downloaded app does not start
The LSOpenURLsWithRole is a function that is used to associate a file with a program. The file you're double clicking on is not actually an application, but a data file.
This is how, for example, when double-clicking a text document, the TextEdit program or another associated app is launched.
You need to associate it with the java runtime, assuming that you have it installed.
If you right-click on the file and select Get Info, the info pane has a section called "Open With:". That should be set to the java runtime.
For anyone coming here who is seeing this issue for a non-Java program: I was getting the same error message when trying to run a .app file which contains a Mach-O executable. Trying to run the executable directly from within the bundle (e.g. Foo.app/Contents/MacOS/bar
) gave me a much better error indicating I was missing a dynamic lib dependency:
dyld: Library not loaded:/usr/local/opt/qt5/lib/QtWidgets.framework/Versions/5/QtWidgets
Something to try if you are seeing this error.
I was also encountering this error with a Java program I was trying to deploy. I could not get it to work on my second Mac: 10.11.6. I looked everywhere for the answer, but never found one, so I'm putting this here for others to benefit. By launching the System Console, I discovered the error message that the "open" program could not find the program "JavaApplicationStub" in the bundle Contents. The problem is, my bundle was using "JavaAppLauncher" to launch. I had just changed from using the old Apple JarBundler to the Oracle AppBundler so I could sign the app, and the launch program name is different. The key here is that the new bundle (version 7.1.1) was replacing the old one (version 7.1.0), and had the same application name. The old one used JavaApplicationStub to launch.
It appears the Info.plist properties for the program were cached, and it was using stale values to launch the new bundle. Don't know if the cache is cleared on logout or reboot, or if this is fixed in newer versions of OS X, but I have to have this work smoothly for all end users.
I got around the problem by including the version number in the program name.