Hi guys, does anyone knows how to deal with distri...
# compose-desktop
m
Hi guys, does anyone knows how to deal with distributable for macOs? I created a jar just for tests - it works fine. Now I tried to create a distributable, build is finished but due to gson dependency I’ve got :
Caused by: java.lang.ClassNotFoundException: java.sql.Time
Am I able to add this module to dmg?
t
I had similar issue, but not with
java.sql.Time
but with
java.logging
. and I had to add
modules("java.logging")
inside
nativeDistributions
block. Similarly , there should be some module that'll add
java.sql.Time
to your build. am not sure if its similar to mine. maybe @olonho can help here.
👍 2
o
Try adding “java.sql” module, see https://docs.oracle.com/javase/9/docs/api/module-overview-frame.html for full list
👍 1
m
Thank you guys, it works! Doesn’t know where to place
module
before 🙂
1
j
@olonho Perhaps we can catch such problems at build time by performing some sort of verification step?
1
I went ahead and created a bug to track this: https://github.com/JetBrains/compose-jb/issues/463
o
maybe, but guess instead of “we” it shall be jlink devs
j
Yeah, probably that is true.
Although, isn't the
nativeDistributions
block something we own/created? We would want an error message that makes it clear what the expected fix would be, including mentioning the
nativeDistributions
block which I think jlink would not know about.
o
yes,
nativeDistributions
is controlled by our plugin, maybe we could improve error handling somewhat, but feature seems to belong to jlink
s
jdk has a tool called jdeps for that purpose. Ideally build tools plugins will use jdeps and feed it’s output to jlink
Here is the command that will print all the required modules for a jar
Copy code
$ jdeps --print-module-deps --ignore-missing-deps build/libs/app-1.0.0-72.jar                                                    
java.base,java.compiler,java.desktop,java.net.http,jdk.httpserver,jdk.management.jfr

https://res.infoq.com/presentations/openjdk-containers/en/slides/sl17-1589893580942.jpg