arnaudroger / SimpleFlatMapper

Fast and Easy mapping from database and csv to POJO. A java micro ORM, lightweight alternative to iBatis and Hibernate. Fast Csv Parser and Csv Mapper
http://simpleflatmapper.org
MIT License
437 stars 76 forks source link

java.lang.UnsupportedClassVersionError: org/simpleflatmapper/util/CheckedConsumer has been compiled by a more recent version of the Java Runtime (class file version 53.0), this version of the Java Runtime only recognizes class file versions up to 52.0 #673

Closed arnzel closed 5 years ago

arnzel commented 5 years ago

Hi , i have a strange error currently. When running some tests for a software which has a depnedency to simpleflat mapper jdbc (Version 6.7.0) i get this error

"java.lang.UnsupportedClassVersionError: org/simpleflatmapper/util/CheckedConsumer has been compiled by a more recent version of the Java Runtime (class file version 53.0), this version of the Java Runtime only recognizes class file versions up to 52.0"

I use Intellij and set

So i wonder why this file is compiled with Java 9.

a few weeks ago i run the same version of the software with an olde rIntellij version and everything was fine. Also on gitlab ci this error does not happen.

Has anyone a clue what happened ?

arnaudroger commented 5 years ago

is this error in intellij? does the build work from the command line with java8? in the maven preferences -> Importer what is the vm setup?

the artifact version is managed via profiles that depends on the vm that is ran, somenody recently at an issue in intellij running with sdk 7... I think it would be better to have an alternative approach to make sure all the dep are in the same classifier... but I don't know of any with maven

arnzel commented 5 years ago

Hi running "mvn test" from the command line does not produce this error.

The jdk for import is "Use Internal JRE (java version 11.0.3+12)". even when i switch do a OpenJdk8 version from my computer the error occurs.Same with Oracle JDK 8 version

arnaudroger commented 5 years ago

have you tried reimporting the maven project after changing the importer? the dependency classifier is selected depending the the jvm running - I tried to see if there is a way to force the classifier down the dependency tree to no avail so far.

arnzel commented 5 years ago

Hi @arnaudroger thanks for the help. After reimport everything works as expected :) Tests run from Intellij runs successfully :)

arnaudroger commented 5 years ago

🍾 will need to document that, it's a bit of pain that I can't seem to be able to solve that in maven ... might see if I can raise a ticket in intellij to use the sdk of the project for the maven import.

arnaudroger commented 5 years ago

there is already an issue https://youtrack.jetbrains.com/issue/IDEA-203432

arnaudroger commented 5 years ago

that should be fixed in 8 https://simpleflatmapper.org/2019/09/01/v8.0.0.html I changed the build and I don't use the classifier anymore, instead it generate different artifactId for each jre version