hi, I'm having problem with running Kotlin .jar fr...
# gradle
a
hi, I'm having problem with running Kotlin .jar from Java, I'm writing plugin that works correctly when written in Java, but crashes when compiled with Kotlin, error is:
Copy code
java.lang.NoClassDefFoundError: kotlin/jvm/internal/Intrinsics
. I see that kotlin folder was correctly compiled into .jar
c
Check your dependencies, I've often seen this error when two different versions of stdlib are present in the project.
./gradlew :your:module:dependencyInsight --dependency kotlin-stdlib
replace
:your:module:
with your own values of course.
a
Copy code
./gradlew :JsonTransformation:dependencyInsight --dependency kotlin-stdlib
Downloading <https://services.gradle.org/distributions/gradle-4.10.2-bin.zip>
..........................................................................

> Task :JsonTransformation:dependencyInsight
org.jetbrains.kotlin:kotlin-stdlib:1.3.0
   variant "default" [
      org.gradle.status                  = release (not requested)
      Requested attributes not found in the selected variant:
         org.gradle.usage                   = java-api
         org.jetbrains.kotlin.platform.type = jvm
   ]

org.jetbrains.kotlin:kotlin-stdlib:1.3.0
\--- compileClasspath

org.jetbrains.kotlin:kotlin-stdlib-common:1.3.0
   variant "runtime" [
      org.gradle.status                  = release (not requested)
      Requested attributes not found in the selected variant:
         org.gradle.usage                   = java-api
         org.jetbrains.kotlin.platform.type = jvm
   ]

org.jetbrains.kotlin:kotlin-stdlib-common:1.3.0
\--- org.jetbrains.kotlin:kotlin-stdlib:1.3.0
     \--- compileClasspath

A web-based, searchable dependency report is available by adding the --scan option.

BUILD SUCCESSFUL in 15s
1 actionable task: 1 executed
how should I interpret it?
c
strange, i don't see any other versions here, my idea is problably wrong then.
oh, you're using gradle 4.10.2, it's not compatible with kotlin 1.3.0, if you're writing a plugin you should use 1.2.61 for 4.10.2
a
ok, let me check it
thank you, that led me to actual solution, .jar was properly built, but there was property that I need to set
JsonTransformation.Assertion.ui.allowed.packages=kotlin
now it works
p
Any link that an issue that kotlin 1.3 is incompatible with the latest Gradle version @Czar
c
From what I understand when you're writing a gradle plugin you have to use the version of kotlin bundled in gradle. That may or may not be the case, though. I should've added "I think so" 🙂
Since Adrian made it work, seems I wasn't right after all.
i