Getting error with a very basic “hello world from jar” searched forum but not found any satisfactory solution
Exception in thread "main" java.lang.NoClassDefFoundError: kotlin/jvm/internal/Intrinsics
at MainfileKt.main(Mainfile.kt)
Caused by: java.lang.ClassNotFoundException: kotlin.jvm.internal.Intrinsics
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 1 more
I am using all painful tools listed as below.
Kotlin (latest 1.2.41)
Gradle (4.7)
intellij community 2018.1
in my gradle i have added additional lines (please note i am not using any package)
jar{
manifest {
attributes (
'Main-Class': 'MainfileKt'
)
}
}
Please note my structure is
src
---->main
------------>kotlin (Please note its NOT java)
-------------------->Mainfile.kt
my Mainfile.kt
fun main(args: Array<String>) {
println("hello world")
}
I am super irritated trouble shoot and finding online what I am doing wrong but no luck (I hope my manage will allow me go back to java sooner)
Please also note that, when I am giving class name as just Mainclass in my manifest, while running jvm says that it can not find class called Mainclass, this proves atleast JVM is able to MainclassKt