Michael Paus
06/12/2021, 10:43 AMLSOpenURLsWithRole() failed with error -10810 for the file ...MyApp.app.
which is also not very informative. When I then manually run the contents of the created app-image as a Java program I get:
Caused by: org.jetbrains.skiko.LibraryLoadException: Cannot find libskiko-macos-x64.dylib.sha256, proper native dependency missing.
at org.jetbrains.skiko.Library.load(Library.kt:43)
at org.jetbrains.skija.impl.Library$Companion.staticLoad(Library.kt:12)
at org.jetbrains.skija.impl.Library.staticLoad(Library.kt)
at org.jetbrains.skija.Path.<clinit>(Path.java:27)
The app-image contains both libskiko-macos-x64.dylib and libskiko-macos-x64.dylib.sha256. Does anybody have an idea what is going on here?darkmoon_uk
06/12/2021, 11:48 AMdarkmoon_uk
06/12/2021, 11:49 AMdarkmoon_uk
06/12/2021, 11:50 AMcompose.desktop {
application {
...
nativeDistributions {
...
modules("java.net.http")
darkmoon_uk
06/12/2021, 11:51 AMLSOpenURLsWithRole()
...that's because Java HTTP is missing and can be included with the above line.darkmoon_uk
06/12/2021, 11:51 AMmodules("<http://java.net|java.net>.http")
darkmoon_uk
06/12/2021, 11:54 AMapi(compose.desktop.common)
instead of
api(compose.desktop.currentOs)
...but it doesn't sound like this is the same in your case. You say you're running the contents of the App image manually; is this bypassing scripts that would otherwise be setting the JVM library path?
libskiko-macos-x64.dylib.sha256
would certainly need to be on the JVM's library path.darkmoon_uk
06/12/2021, 11:55 AMsuggestRuntimeModules
that can search the classes you're using and advise on the Java modules to include. I don't know how reliable it is.Michael Paus
06/12/2021, 12:23 PMmodules("java.base","java.naming","java.prefs","java.scripting","java.sql","jdk.jfr","jdk.unsupported","jdk.unsupported.desktop","<http://jdk.crypto.ec|jdk.crypto.ec>","jdk.localedata")
I found them by using jdeps
on my original JavaFX application where I do the packaging more manually and therefore have more insight on what is going on.
Its embarrassing but I should have known that because I have written a tutorial
about that for JavaFX myself together with Dirk Lemmermann. (https://github.com/dlemmermann/JPackageScriptFX)Michael Paus
06/12/2021, 12:30 PM#!/bin/bash
APP_CONTENTS=build/compose/binaries/main/app/MapDemoDesktop.app/Contents
# This works only if the native commands are not stripped
#JAVA_HOME=${APP_CONTENTS}/runtime/Contents/Home
${JAVA_HOME}/bin/java \
-cp "${APP_CONTENTS}/app/*" \
-Djava.library.path="${APP_CONTENTS}/app/" \
-ea \
-Xmx2048m \
MainKt
darkmoon_uk
06/12/2021, 12:43 PMlibskiko-macos-x64.dylib.sha256
can be found in build/compose/binaries/main/app/MapDemoDesktop.app/Contents/app/
? Otherwise there's your problem.Michael Paus
06/12/2021, 12:45 PMsuggestRuntimeModules
task also works. The list can then be shortened to
modules("java.instrument", "java.prefs", "java.sql", "jdk.unsupported","<http://jdk.crypto.ec|jdk.crypto.ec>","jdk.localedata")
The last two had to be added manually and where not suggested. The first of these is needed for https connections.darkmoon_uk
06/12/2021, 12:46 PMjava.instrument
for HTTPS! I'll run into that sooner or later...Michael Paus
06/12/2021, 12:47 PM<http://jdk.crypto.ec|jdk.crypto.ec>
I meant the first of the two which I added manually.darkmoon_uk
06/12/2021, 12:48 PM<http://jdk.crypto.ec|jdk.crypto.ec>
...darkmoon_uk
06/12/2021, 12:48 PMMichael Paus
06/12/2021, 12:51 PM