https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
b

brabo-hi

09/26/2023, 12:48 AM
Hello guy, in a Kmm project that targets JVM, how to create a jar lib of it
j

John Dior

09/26/2023, 5:05 AM
Copy code
./gradlew packageUberJarForCurrentOS         
or
./gradlew desktopJar
l

Loïc Lamarque

09/26/2023, 12:49 PM
@brabo-hi You can run the following command for creating a JVM Jar in a multiplatform project :
./gradlew :jvmJar
. It will be available in the
build/libs
directory.
b

brabo-hi

09/27/2023, 12:46 AM
Thank you @Loïc Lamarque working
l

Loïc Lamarque

09/27/2023, 9:10 AM
Your welcome @brabo-hi.
b

brabo-hi

10/01/2023, 12:50 AM
@Loïc Lamarque it looks like the jar doesn't contains libraries declared as dependencies, how can i create a java that contains all it corresponding dependencies
l

Loïc Lamarque

10/01/2023, 12:14 PM
This is something that I researched recently @brabo-hi. You need to create a task that will assemble a Fat JAR. I don't exactly know how to do it for a Kotlin Multiplatform project, but here's an article for the JVM platform: Creating a Fat JAR in Gradle.
🔥 1