0

My application is compatible with Java8 so I am using the below lib but the below one has a bug according to AssertionConsumerIndex-Issue which is resolved in the v5.1.4 version but when I am upgrading faced issue.

What show I have to do?

pluginLibsCompile 'org.pac4j:jee-pac4j:5.0.1-SNAPSHOT'
pluginLibsCompile 'org.pac4j:pac4j-oauth:4.1.0'

pluginLibsCompile 'org.pac4j:pac4j-http:4.1.0'
pluginLibsCompile 'org.pac4j:pac4j-ldap:4.1.0'
pluginLibsCompile 'org.pac4j:pac4j-jwt:4.1.0'

Upgraded to this
pluginLibsCompile 'org.pac4j:pac4j-saml:5.1.5'

I am getting an error

bad class file: /home/rohit/.gradle/caches/modules-2/files-2.1/org.pac4j/pac4j-core/5.1.5/aa60f665ef03852ce6c92a3cc26caf797640d60b/pac4j-core-5.1.5.jar(org/pac4j/core/context/JEEContext.class) class file has wrong version 55.0, should be 52.0 Please remove or make sure it appears in the correct subdirectory of the classpath.

M. Deinum
  • 115,695
  • 22
  • 220
  • 224
  • 1
    First I doubt it is wise to mix versions of a framework/libraryu. o mixing 5.0.1, 4.1.0 and 5.1.5 (or higher) is wise, I suspect they should match. That being said, class version 55 is java 11 so it seems that that version of the library isn't usable with Java8 and has a minimum requirement on Java11. Which according to the pac4j website is right. 5.x is Java11, 4.x is Java8 and 6.x is Java 17. – M. Deinum Jul 09 '23 at 14:23
  • @M.Deinum why not put that as an answer? – eis Jul 09 '23 at 14:26

1 Answers1

1

The error you get indicates that the classes you are using are compiled with Java 11. class file has wrong version 55.0, should be 52.0 the answer has a list with a lot of Java versions and class file version and a link to the source of this.

If you check the Pac4J Documentation this would have been pretty clear as the documentation states that

  • Version 4.x is Java 8
  • Version 5.x is Java 11
  • Version 6.x is Java 17

So either you cannot use version 5.1 and stick with the latest in the 4.x branch or you would need to upgrade to a newer Java version as well. Which I would recommend as Java 8 is getting a bit dated.

In addition I doubt it is wise to mix versions of a framework/library that is in use, as that will certainly lead to incompatibility issues. Your current project appears to be mixing 4.1.0, 5.0.1 and 5.1.5, the versions should all align.

M. Deinum
  • 115,695
  • 22
  • 220
  • 224
  • I can't able to stick to 4.x branch because of an bug AssertionConsumerIndex-Issue which is fixed in 5.1.4 , In that case what Should I have to do: - Just because of this we can't shift java-version of our commerce application from java 8 to 11 , Is there any other thing I would can do that ? – rohit pawar Jul 10 '23 at 05:54
  • No, you either stick with the version you can use 4.x or upgrade java. Those are your options (as explained). – M. Deinum Jul 10 '23 at 06:20