Java versioning issues when deploying my plugin

I'm the author of gitflow4idea, the git flow integration plugin.

Lately my users have been complaning about "com.intellij.diagnostic.PluginException: gitflow/GitflowComponent : Unsupported major.minor version 51.0 [Plugin: Gitflow]"

To me it sounds like a JDK version issue, but I'm not sure how to resolve it.
Is it a problem with the way I'm building the plugin? Or maybe something with the users' system?

I was under the impression that plugins are JDK-agnostic since the JRE is bundled with Intellij itself? Is that not the case?
When I build my plugin, the module SDK is defined as follows:

How can I approach this issue?


Please use JDK 6 as underlying SDK for the IntelliJ Platform SDK as many/most users on Mac still use
it to run IntelliJ IDEA.


Thanks for the tip Yann, that seemed to sort everything out for my users :)


I'm running into this frequently with the Mac users of my plugin as well.  Is the only option aside from telling users to run the IDE with a more recent release of Java really to build the plugin with Java 6?  Is it possible to develop for the Java 7 language spec and compile/package Java 6 byte code easily?  It's not that much of a difference, but there are definitely some great conveniences in the more recent versions of Java, not to mention that it's not end-of-life.


Yes, you need to build the plugin for Java 6. You can't tell Mac users to run with a later JDK because they all have serious bugs which affect some (large) proportion of users. The bundled JDK is getting better but it still doesn't work for me and is only available for recent IntelliJ versions. JDK 6 is still the safest option for a lot of users (including me), although that also has some bugs now under Yosemite as it bit-rots.

You can cross-compile using tools like retroweaver, but I've never tried it. You could also consider Kotlin - it has many of the niceties of JDK8 and more, and it compiles to JDK6 bytecode. IntelliJ contains a "convert to Kotlin" action which does a passable job of converting Java to Kotlin. I'm gradually migrating my codebase now and I'm finding it to be a very pleasant experience.


Thanks, Colin. I actually assumed this would be the case and went ahead and made the necessary changes to my plugin source to compile with Java 6.  The biggest pain was filling in the generic params!  Maybe I'll give Kotlin a look as well, but for now I think I'm over the hump.


Please sign in to leave a comment.