Could not find or load main class com.intellij.idea.Main
Answered
I have updated the JDK to correto-17 and SDK to PhpStorm PS-231.8109.199
But now when I build the plugin and try to execute/debug, after it finish the build process it throws this error:
Error: Could not find or load main class com.intellij.idea.Main
Caused by: java.lang.ClassNotFoundException: com.intellij.idea.Main
Can you help me to solve this or tell me what could be causing it?
Please sign in to leave a comment.
Hi Enrique,
Make sure you use the latest Gradle and Gradle IntelliJ Plugin.
If it doesn't help, please provide a minimal reproducible example.
Hi Karol, can you please tell me the steps to do that? I cannot find anything related to Gradle in my project, this was working fine with previous IntelliJ version, I have installed:
My Gradle plugin says: bundled 231.8109.175
Compiling the plugin and generating the .jar file seems to be working fine, the problem is when trying to debug the project, it fails when trying to create the PhpStorm instance.
This is all I have in debug window:
Hi Enrique,
Sorry for the delay.
I didn't mean the Gradle IDE plugin. I wrongly assumed you use Gradle IntelliJ Plugin: https://github.com/JetBrains/gradle-intellij-plugin for building and running the plugin. It is the recommended approach for developing plugins, so if you can, I suggest migrating.
See: https://plugins.jetbrains.com/docs/intellij/migrating-plugin-devkit-to-gradle.html
If you must use the DevKit approach for some reason, please share your run configuration.
What do you mean with share de run configuration? do you need some specific files o screencap?
It can be screenshots. I mean the settings in Run | Edit Configurations....
Hi, here it is
In JRE instead of JDK try to use IntelliJ SDK or default SDK of selected module - this have worked for me in older version od IntelliJ.
Thanks Marcin! I can run it now, but only with this config:
If I set the this one:
Then it fails with this error: