Reputation: 41
I am working on an IntelliJ plugin in which I generate the Builder pattern. However, I cannot seem to use the plugin because of something called the PluginException. I reproduced the error in the same five steps as this post, and because no answer is posted there I decided to give some code examples in this question (and I am not allowed to comment on the other question. That has a lot to do with it too).
The code can be found here. The test-plugin should generate a field with a getter in the current class, and an inner class of a new type (NumberFactory). The stacktrace I get after installing the plugin is the following one:
*cannot create class "be.koen.wellens.MyBuilderGeneratorAction" [Plugin: be.koen.wellens]: cannot create class "be.koen.wellens.MyBuilderGeneratorAction" [Plugin: be.koen.wellens]
com.intellij.diagnostic.PluginException: cannot create class "be.koen.wellens.MyBuilderGeneratorAction" [Plugin: be.koen.wellens]
at com.intellij.openapi.actionSystem.impl.ActionManagerImpl.a(ActionManagerImpl.java:287)
at com.intellij.openapi.actionSystem.impl.ActionManagerImpl.a(ActionManagerImpl.java:239)
at com.intellij.openapi.actionSystem.impl.ActionManagerImpl.getAction(ActionManagerImpl.java:232)
at com.intellij.openapi.actionSystem.DefaultActionGroup.unStub(DefaultActionGroup.java:345)
at com.intellij.openapi.actionSystem.DefaultActionGroup.getChildren(DefaultActionGroup.java:303)
at com.intellij.openapi.actionSystem.impl.ActionManagerImpl$5.compute(ActionManagerImpl.java:1261)
at com.intellij.openapi.actionSystem.impl.ActionManagerImpl$5.compute(ActionManagerImpl.java:1254)
at com.intellij.openapi.application.impl.ApplicationImpl.runReadAction(ApplicationImpl.java:932)
at com.intellij.openapi.actionSystem.impl.ActionManagerImpl.a(ActionManagerImpl.java:1254)
at com.intellij.openapi.actionSystem.impl.ActionManagerImpl.preloadActionGroup(ActionManagerImpl.java:1248)
at com.intellij.codeInsight.generation.actions.GenerateAction.preload(GenerateAction.java:91)
at com.intellij.openapi.actionSystem.impl.ActionManagerImpl.a(ActionManagerImpl.java:1266)
at com.intellij.openapi.actionSystem.impl.ActionManagerImpl.a(ActionManagerImpl.java:1269)
at com.intellij.openapi.actionSystem.impl.ActionManagerImpl.preloadActionGroup(ActionManagerImpl.java:1248)
at com.intellij.openapi.actionSystem.impl.ActionManagerImpl.c(ActionManagerImpl.java:1236)
at com.intellij.openapi.actionSystem.impl.ActionManagerImpl.access$200(ActionManagerImpl.java:73)
at com.intellij.openapi.actionSystem.impl.ActionManagerImpl$4.run(ActionManagerImpl.java:1220)
at com.intellij.openapi.application.impl.ApplicationImpl$8.run(ApplicationImpl.java:419)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:439)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
at java.lang.Thread.run(Thread.java:695)
at com.intellij.openapi.application.impl.ApplicationImpl$1$1.run(ApplicationImpl.java:149)
Caused by: com.intellij.diagnostic.PluginException: be/koen/wellens/MyBuilderGeneratorAction : Unsupported major.minor version 51.0 [Plugin: be.koen.wellens]
at com.intellij.ide.plugins.cl.PluginClassLoader.b(PluginClassLoader.java:130)
at com.intellij.ide.plugins.cl.PluginClassLoader.a(PluginClassLoader.java:77)
at com.intellij.ide.plugins.cl.PluginClassLoader.loadClass(PluginClassLoader.java:66)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:249)
at com.intellij.openapi.actionSystem.impl.ActionManagerImpl.a(ActionManagerImpl.java:262)
... 24 more
Caused by: java.lang.UnsupportedClassVersionError: be/koen/wellens/MyBuilderGeneratorAction : Unsupported major.minor version 51.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:637)
at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
at java.lang.ClassLoader.defineClass(ClassLoader.java:471)
at com.intellij.util.lang.UrlClassLoader._defineClass(UrlClassLoader.java:195)
at com.intellij.util.lang.UrlClassLoader.defineClass(UrlClassLoader.java:191)
at com.intellij.util.lang.UrlClassLoader._findClass(UrlClassLoader.java:167)
at com.intellij.ide.plugins.cl.PluginClassLoader.b(PluginClassLoader.java:124)
... 30 more*
Thanks in advance!
Koen
Upvotes: 3
Views: 3817
Reputation: 41
The answer was given by Meo (thanks, Meo!). All I had to do was use JDK 1.6.. If only all things in life were that simple. :-)
Once more, thanks very much!
Upvotes: 1