Class not found when running plugin
Answered
Hi there. I added an action to my plugin and when I tested it, I got this:
Caused by: java.lang.ClassNotFoundException: com.github.jwpjrdev.betterimportplugin.actions.ImportAction PluginClassLoader[PluginDescriptor(name=better-import-plugin, id=com.github.jwpjrdev.betterimportplugin, path=/Users/joshua/Desktop/better-import-plugin/build/idea-sandbox/plugins/better-import-plugin, version=0.0.1)] com.intellij.ide.plugins.cl.PluginClassLoader@4fd64a7c
This is what I have in plugin.xml (generated by IntelliJ):
<actions>
<action id="com.github.jwpjrdev.betterimportplugin.actions.ImportAction"
class="com.github.jwpjrdev.betterimportplugin.actions.ImportAction" text="ImportAction"
description="Triggered when the import hotkey is ran">
<keyboard-shortcut keymap="$default" first-keystroke="shift meta O"/>
</action>
</actions>
And all the action does is listen to AnActionEvent via actionPerformed and print a string to console.
Thoughts?
Please sign in to leave a comment.
Update: I'm dumb and had a Java file in src/main/kotlin rather than src/main/java.
same mistake!
Made the same mistake today… :D
Made the same mistake, thanks!
Made the same mistake, and I solved this exception by renaming kotlin directory to java. "src/main/kotlin" -> "src/main/java"
Thank you!!! This has wasted so much time. I wish the IntelliJ plug-in documentation warned you about this.