OS X application won't launch with jigsaw
mik3hall at gmail.com
Wed Nov 25 22:54:04 UTC 2015
> On Nov 25, 2015, at 10:45 AM, Danno Ferrin <danno.ferrin at oracle.com> wrote:
> However, we fully expect that the Java 8 packager will not be able to make bundles holding a Java 9 runtime, and I think this is what you are encountering.
What I had done was use javapackager to generate an application bundle for 7 or 8. Not sure which anymore, I’ve been reusing the same one for a while.
Then I take the output of jdk 9 builds and paste it into the plugins directory of that same application.
This has been working fine until I tried a jigsaw specific ea.
Now the application doesn’t launch.
The launch errors output a single message to the console log that the application failed to launch.
I have a shell script that launches the application that way. This fails indicating it is trying to access the apple legacy api’s. Which it should. Access them that is, not should fail. It does fail because these classes have been classified ‘internal’ and are inaccessible with the current jake builds.
Exception in thread "main" java.lang.IllegalAccessError: class us.hall.osx.OSXApplication (in module: Unnamed Module) cannot access class com.apple.eawt.Application (in module: java.desktop), com.apple.eawt is not exported to Unnamed Module
My understanding is that JEP 272 out of the awt group is addressing these classes. Converting them to a Desktop api that will be supported going forward. It will I’m assuming require changes on the part of any current OS X applications using the apple api’s to instead use the new Desktop api’s. I am ok with this. As long as I know about it and the changes aren’t massive.
However, for any OS X developers not actively following the java 9 project this may become a problem in migration. javapackager, or whatever tool the developers use to create their application bundles could work fine but due to use of these api’s their applications won’t launch.
I’m sort of guessing javapackager might be the only tool at that point that will create valid application bundles. That or my way, guessing how a pasted in embedded jdk should work and just manually copying it in. As long as the changes don’t develop any other complications before the project completes so that by itself doesn’t work.
Anyhow I don’t believe the issues are javapackager, they are making formerly public apple ‘extra’ api’s now ‘internal’ ones whose use causes the application to fail.
More information about the jigsaw-dev