0

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?

Olaf Kock
  • 46,930
  • 8
  • 59
  • 90
Mohan
  • 35
  • 6
  • You might have to rebuild it especially for that version – g00se Apr 26 '22 at 12:27
  • 1
    Obviously your version of Apache Ignite was compiled for Java 8. It cannot run on Java 7. As an aside, unless you have an expensive support contract, support for Java 7 ended a few years ago. You really should update. – Mark Rotteveel Apr 26 '22 at 12:37
  • @MarkRotteveel is there are any version of ignite jars with build using jdk 1.7? so that it will help to achieve in current scenario... – Mohan Apr 26 '22 at 12:42
  • 1
    You will need to check older Ignite versions if they are compatible with Java 7 or not, I'm not going to dig through older versions for you. – Mark Rotteveel Apr 26 '22 at 12:44
  • Does this answer your question? [How to fix java.lang.UnsupportedClassVersionError: Unsupported major.minor version](https://stackoverflow.com/questions/10382929/how-to-fix-java-lang-unsupportedclassversionerror-unsupported-major-minor-versi) – Olaf Kock Apr 26 '22 at 13:07
  • @OlafKock java 8 is working for me, but i am looking to achieve in java 7 , since the application requirement with java 7 only – Mohan Apr 26 '22 at 13:22
  • if ignite is compiled with Java8, you might need to recompile it (and hope that it's Java7 compatible). The linked item definitely describes the root cause of your problem. – Olaf Kock Apr 26 '22 at 15:03

2 Answers2

1

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

Stephen C
  • 698,415
  • 94
  • 811
  • 1,216
  • ignite-core-2.3.0 jars worked with java 7 , thank you Stephen , and will take the java upgrading also as valuable comments... – Mohan Apr 27 '22 at 16:36
0

The minimum supported version is Java 8. I don't think you'll get it working on anything older. Java 7 was released in 2011 and has not been supported for some time.

Stephen Darlington
  • 51,577
  • 12
  • 107
  • 152