InteliJ Plugin development: Java class not found exception
已回答
Hello,
Im trying to use Kotlin and Java together in project and Im getting Java class not found exception when running runIde option from the github plugin template. I have used Github plugin template to start the project which comes with Kotlin but now i need some java code to implement Configurable for plugin settings ( Inspired by code sample demos ). Im not sure what im doing wrong or if this maybe is not possible at all.
Project structure
Plugin.xml
Error after running runIde and clicking on tools. ( Kotlin scripts run without problem )
(IOException error is unrelated and rooted in one of kotlin files where im just trying something.)
Im new to Kotlin and InteliJ plugins, I would be grateful for any advice. Thank you.
请先登录再写评论。
Hi,
Please share you Gradle build script and related Gradle files.
Gradlew
gradle.properties
gradlew.bat
Thanks. I don't see any issue with your build script, but the screenshots indicate some errors. I don't understand why your
main/java
andmain/kotlin
directories are not marked as sources. Did you import the Gradle project model after creating the project? In the Gradle tool window click Reload All Gradle Projects.If it doesn't help, please share the project sources.
Done it. Now it marks them as sources but the same error is still there. Any ideas ?
Also there is weird setup, I have two gradle directories now. I guess its using the top one when i try to run the runIde.
Your project structure looks strange.
Why do you have
saaf-plugin-main
directories twice? You probably created a directory and cloned it to the directory with the same name, resulting in double dir. Either open the internal one or move your file to the top-level directory and open the top-level in the IDE.After cleaning this up, import and build the project and see whether the build/classes contains the classes that are highlighted in red in the plugin.xml.
If not, see what is the log message. Are there any errors?
Ive cloned the project anew with proper structure. Now im not sure how to add java files as another source beside Kotlin directory. Just adding the directory and files leads to same error.
Finally got it. It is built under different path. I saw it when i looked into build folder. Thank you for help !!