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?

0
6 comments
Avatar
Permanently deleted user

Update: I'm dumb and had a Java file in src/main/kotlin rather than src/main/java.

6

Made the same mistake today… :D

0

Made the same mistake, thanks!

0

Made the same mistake, and I solved this exception by renaming kotlin directory to java. "src/main/kotlin" -> "src/main/java"

2

Thank you!!! This has wasted so much time. I wish the IntelliJ plug-in documentation warned you about this.

0

Please sign in to leave a comment.