Skip to content

This is a sample application written in Kotlin to package the application as fat jar.

Notifications You must be signed in to change notification settings

niksw7/gradle-kotlin-demo

Repository files navigation

gradle-kotlin-demo

This is a sample application written in Kotlin to package the application as fat jar.

./gradlew build
java -jar build/libs/gradle-kotlin-demo-0.0.1.jar

The intent of this project is to get a shippable jar out of kotlin source code. And to avoid getting entangled in java.lang.NoClassDefFoundError errors.
eg: This branch has code for failing jar which produces this error output

Exception in thread "main" java.lang.NoClassDefFoundError: kotlin/jvm/internal/Intrinsics
	at com.loreans.demo.GreeterApplicationKt.main(GreeterApplication.kt)
Caused by: java.lang.ClassNotFoundException: kotlin.jvm.internal.Intrinsics
	at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)

The fix has been provided in here

About

This is a sample application written in Kotlin to package the application as fat jar.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages