java.lang.NoClassDefFoundError: org/jetbrains/kotlin/psi/KtClass
Answered
I use https://github.com/JetBrains/intellij-platform-plugin-template create project .
this is my build.gradle.kts
fun properties(key: String) = providers.gradleProperty(key)
fun environment(key: String) = providers.environmentVariable(key)
plugins {
id("java") // Java support
alias(libs.plugins.kotlin) // Kotlin support
alias(libs.plugins.gradleIntelliJPlugin) // Gradle IntelliJ Plugin
}
group = properties("pluginGroup").get()
version = properties("pluginVersion").get()
repositories {
mavenCentral()
}
dependencies {
implementation(libs.annotations)
// implementation("org.jetbrains.kotlin:kotlin-compiler:1.9.21")
}
// Set the JVM language level used to build the project. Use Java 11 for 2020.3+, and Java 17 for 2022.2+.
kotlin {
@Suppress("UnstableApiUsage")
jvmToolchain {
languageVersion = JavaLanguageVersion.of(17)
vendor = JvmVendorSpec.JETBRAINS
}
}
// Configure Gradle IntelliJ Plugin - read more: https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html
intellij {
pluginName = properties("pluginName")
version = properties("platformVersion")
type = properties("platformType")
// Plugin Dependencies. Uses `platformPlugins` property from the gradle.properties file.
plugins = properties("platformPlugins").map { it.split(',').map(String::trim).filter(String::isNotEmpty) }
}
in my gradle.properties . I add "platformPlugins = org.jetbrains.kotlin"
when the plugin about package org.jetbrains.kotlin.psi
it error.
what should i do
Please sign in to leave a comment.
You missed step 3), declaration in plugin.xml? https://plugins.jetbrains.com/docs/intellij/plugin-dependencies.html
Thank you very much!
I'm sorry for my lack of seriousness