Search code examples
javaignite

UnsupportedClassVersionError problem on Apache Ignite using Java 7 with Ignite jars


I am using Apache Ignite server in my application with Ignite jars (Ignite jar version 2.12.0) alone and I did not implemented with the Ignite standalone software, since it requires separate software.

The problem is that, when used with Java 8, it is running properly, when used with Java 7, it is showing UnsupportedClassVersionError.

Note: In my application the requirement is Java 7 only.

Error details:

java.lang.UnsupportedClassVersionError: org/apache/ignite/spi/discovery/tcp/ipfinder/TcpDiscoveryIpFinder : Unsupported major.minor version 52.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)

Could any one guide on that? How to use Apache Ignite with Java 7?


Solution

  • I concur with @Mark Rotteveel. Java 7 is long past its end-of-life, and continuing to develop new code for that platform is a mugs game1, 2.

    Upgrade to Java 8. Tell the boss it needs to be done.

    However, assuming that you want to keep digging yourself deeper into the Java 7 hole ...

    Looking at the Apache Ignite release history, I see that Java 7 support was dropped in Ignite 2.4. So if you were willing and able to roll back to Ignite 2.3 or earlier, there is a good chance you can put off upgrading to Java 8 a bit longer.

    Another alternative would be to checkout more a more recent version of Ignite from the official source repository, and see if you can build it for Java 7. (The Java source and target versions are set in the "parent/pom.xml" file ...)

    Q: Which post 2.4 version(s) of Ignite will still build for Java 7?
    A: I don't know. You may have to modify the code to make it build, especially if they have started using new Java 8+ language features.
    Q: Will the built code work?
    A: I don't know.
    Q: Will the back-ported code be supported by the code authors?
    A: Not a chance!


    1 - ... unless you or your company are being very well paid for doing this work. In that case, the mugs are your clients.
    2 - https://www.merriam-webster.com/dictionary/a%20mug%27s%20game