PhpStorm plugin isn't able to be created/unsupported major.minor version

I'm not sure if this message should be in the Plugin Development forum, or the in PhpStorm forum, so I'll post here first.

I'm in the process of getting up to speed writing a plugin for PhpStorm.  I've created a (simple) plugin for IntelliJ, and now I'm creating a new (equally simple) plugin for PhpStorm.  The plugin action is to be added to the Tools menu, and when clicked, display a dialog box.  I've been ablle to create the action and display the dialog box with the first plugin I created (for intelliJ), but I'm running into some issues now with a new plugin for PhpStorm.

To create the PhpStorm plugin, I followed the same steps I took to create the plugin for IntelliJ...

I selected File > New > Project > IntelliJ Platform Plugin

I then created a new package called com.yourcompany.Sample6Id

I then created a new Action...
Action ID: com.yourcompany.Sample6Id
Class name: Sample6

I then added code to Sample6's actionPerformed() to display a dialog box

I built & compiled plugin #2 (Sample6) & debugged it against IntelliJ just to make sure it ran.  So far so good.

I then followed the steps posted at to setup the plugin to be able to run in PhpStorm.  Specifically, I...
1) Added php-openapi.jar and php.jar to the libraries
2) In Dependencies I changed the scope of php-openapi to provided
3) Added <depends>com.jetbrains.php</depends> and <depends>com.intellij.modules.platform</depends> to plugin.xml

I then rebuilt the project, then selected Build > Prepare Plugin Modlue 'Sample6'  For Deployment

I then ran PhpStorm, then selected File> Settings > Plugins > Install Plugin From Disk, browsed to Sample6.jar and selected it, then restarted PhpStorm.

PhpStorm started up w/o any errors, but when I clicked the Tools menu, "Sample6" wasn't present, and en error appeared in the event log:

PluginException: cannot create class "com.yourcompany.Sample6Id.Sample6" [Plugin: com.yourcompany.Sample6Id]

The deatils of the error are:
cannot create class "com.yourcompany.Sample6Id.Sample6" [Plugin: com.yourcompany.Sample6Id]
com.intellij.diagnostic.PluginException: cannot create class "com.yourcompany.Sample6Id.Sample6" [Plugin: com.yourcompany.Sample6Id]
 at com.intellij.openapi.actionSystem.impl.ActionManagerImpl.convertStub(
 at com.intellij.openapi.actionSystem.impl.ActionManagerImpl.a(
 at com.intellij.openapi.actionSystem.impl.ActionManagerImpl.a(
 at com.intellij.openapi.actionSystem.impl.ActionManagerImpl.getAction(
 at com.intellij.openapi.actionSystem.DefaultActionGroup.unStub(
 at com.intellij.openapi.actionSystem.DefaultActionGroup.getChildren(
 at com.intellij.openapi.actionSystem.impl.ActionManagerImpl$5.compute(
 at com.intellij.openapi.actionSystem.impl.ActionManagerImpl$5.compute(
 at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(
 at com.intellij.openapi.actionSystem.impl.ActionManagerImpl.a(
 at com.intellij.openapi.actionSystem.impl.ActionManagerImpl.a(
 at com.intellij.openapi.actionSystem.impl.ActionManagerImpl.preloadActionGroup(
 at com.intellij.openapi.actionSystem.impl.ActionManagerImpl.c(
 at com.intellij.openapi.actionSystem.impl.ActionManagerImpl.access$200(
 at com.intellij.openapi.actionSystem.impl.ActionManagerImpl$
 at com.intellij.openapi.application.impl.ApplicationImpl$
 at java.util.concurrent.Executors$
 at java.util.concurrent.ThreadPoolExecutor.runWorker(
 at java.util.concurrent.ThreadPoolExecutor$
 at org.jetbrains.ide.PooledThreadExecutor$1$
Caused by: com.intellij.diagnostic.PluginException: com/yourcompany/Sample6Id/Sample6 : Unsupported major.minor version 52.0 [Plugin: com.yourcompany.Sample6Id]
 at java.lang.ClassLoader.loadClass(
 at java.lang.Class.forName0(Native Method)
 at java.lang.Class.forName(
 at com.intellij.openapi.actionSystem.impl.ActionManagerImpl.convertStub(
 ... 21 more
Caused by: java.lang.UnsupportedClassVersionError: com/yourcompany/Sample6Id/Sample6 : Unsupported major.minor version 52.0
 at java.lang.ClassLoader.defineClass1(Native Method)
 at java.lang.ClassLoader.defineClass(
 at java.lang.ClassLoader.defineClass(
 at com.intellij.util.lang.UrlClassLoader._defineClass(
 at com.intellij.util.lang.UrlClassLoader.defineClass(
 at com.intellij.util.lang.UrlClassLoader._findClass(
 ... 27 more

From the error logged, it sounds like there's a version mis-match.  I'm not sure where "52" is coming from... the "version" in my plugin.xml is 1.0.  For reference, here is the entire plugin.xml that I have:

<idea-plugin version="2">
  <vendor email="" url="">YourCompany</vendor>

      Enter short description for your plugin here.<br>
      <em>most HTML tags may be used</em>

      Add change notes here.<br>
      <em>most HTML tags may be used</em>

  <!-- please see for description -->
  <idea-version since-build="131"/>

  <!-- please see
       on how to target different products -->
  <!-- uncomment to enable plugin in all products

  <extensions defaultExtensionNs="com.intellij">
    <!-- Add your extensions here -->

    <!-- Add your application components here -->

    <!-- Add your project components here -->

    <!-- Add your actions here -->
    <action id="Sample6Id" class="com.yourcompany.Sample6Id.Sample6" text="Sample6..."
            description="Sample6 description">

      <add-to-group group-id="ToolsMenu" anchor="first"/>


The only reference I've found on PhpStorm development is at and from what I can tell I've set up my project correctly.

The plugin I created so far is pretty simple, so if needed I can post the code, but hopefully that won't be needed.

Any suggestions as to what to do?



Comment actions Permalink

You need to use JDK 6 as the base JDK for your IntelliJ IDEA plugin SDK.

Comment actions Permalink

Thanks!  I've got it working now.



Please sign in to leave a comment.