0

I use the org.reflection library in my code, and i have this error when i run it.

Error 500: javax.servlet.ServletException: java.lang.UnsupportedClassVersionError: JVMCFRE003 version majeure incorrecte; classe=org/reflections/Reflections, décalage=6

My java compiler is 1.6, it is running on a v8.5 web sphere server. And here's my dependency in my pom.xml :

<dependency>
    <groupId>org.reflections</groupId>
    <artifactId>reflections</artifactId>
    <version>0.9.12</version>
</dependency>

Any idea?

Axel
  • 165
  • 3
  • 14

2 Answers2

0

That API is built for 1.8, or at least it mentions 1.8 in the pom explicitly. In general backwards compatibility is assured but forward is not. You're using a 1.6 level JDK, which is really quite old at this point.

If sticking to that is a job requirement, you may be able to identify an older version of the library which works, or you may need to find or write a replacement.

But updating to a JDK from the last half decade really is not a bad idea at all.

J.D. Luke
  • 66
  • 4
0

See https://stackoverflow.com/a/14958377/3864977 for good information about the JVMCFRE003 error. Since this error is coming from org.reflections.Reflections, the reflections library is compiled at a higher Java level than your WebSphere 8.5.5 server is running on. It appears that version 0.9.12 of reflections requires Java 8 - so you should either update your WebSphere installation to use Java 8, or downgrade the reflections dependency to whatever previous version matches your WebSphere java level.

wtlucy
  • 704
  • 3
  • 10
  • How can i find which version match my Websphere java level? Should i just try with each version? – Axel Jul 31 '20 at 14:15
  • Well first you need to know what Java version you're using on WebSphere - checking the header in `SystemOut.log` is a quick way to do that. It doesn't look java levels are documented for the reflections library - but I've just checked and the previous release 0.9.11 is compatible with Java 7. – wtlucy Jul 31 '20 at 15:15
  • I didn't change the version of reflection. What i did is : i changed the default jdk of my server to 1.8, and it worked with reflection 0.9.12 – Axel Aug 06 '20 at 12:02