Compilation issue with Java 11 and Dataverse version before v6.0

107 views
Skip to first unread message

Ludovic DANIEL

unread,
Sep 14, 2023, 8:09:08 AM9/14/23
to Dataverse Users Community
Hello there, we wanted to report an issue regarding compilation of dataverse software source code before version 6.0 that is no longer possible by using Java 11.
The following is a mix of facts and our interpretation that might need deeper analysis.

For the report, the error looks like this :

[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] /tmp/dataverse-5.14/src/main/java/edu/harvard/iq/dataverse/ingest/IngestUtil.java:[42,25] cannot access org.dataverse.unf.UNFUtil
  bad class file: /home/user/.m2/repository/org/dataverse/unf/6.0/unf-6.0.jar(/org/dataverse/unf/UNFUtil.class)
    class file has wrong version 61.0, should be 55.0
    Please remove or make sure it appears in the correct subdirectory of the classpath.
[ERROR] /tmp/dataverse-5.14/src/main/java/edu/harvard/iq/dataverse/ingest/IngestUtil.java:[43,25] cannot access org.dataverse.unf.UnfException
  bad class file: /home/
user/.m2/repository/org/dataverse/unf/6.0/unf-6.0.jar(/org/dataverse/unf/UnfException.class)
    class file has wrong version 61.0, should be 55.0
    Please remove or make sure it appears in the correct subdirectory of the classpath.


This may due to the erase of last version of unf-6.0.jar on Sep 01, 2023 (see https://mvnrepository.com/artifact/org.dataverse/unf/6.0) during the release of Dataverse v6.0 with Java 17.

This means that compilation of sources before version 6.0 (and forked projects) without an historical .m2/repository/org/dataverse/unf/6.0/unf-6.0.jar file must be made with Java 17 (Users with an already downloaded unf-6.0.jar file from previous months still have a Java 11 jar). This also means payara must be run under Java 17 also (I don't know if it's possible).

A way to prevent this kind of issue might be to push new version with updated number on mvn repository instead of erase the jar (6.1 for exemple).

I tested a Dataverse v5.14 compiled under Java 17 and run.. sadly Dataverse installation has been stopped by dvinstall.zip > install.py execution, here is the message :

Found java version openjdk version "17.0.8.1" 2023-08-24 LTS
OpenJDK Runtime Environment Zulu17.44+53-CA (build 17.0.8.1+1-LTS)
OpenJDK 64-Bit Server VM Zulu17.44+53-CA (build 17.0.8.1+1-LTS, mixed mode, sharing)

Dataverse requires OpenJDK 1.8 or 11. Please make sure it's in your PATH, and try again.

The code :
print("Found java version "+java_version)
   if not re.search('(1.8|11)', java_version):
      sys.exit("Dataverse requires OpenJDK 1.8 or 11. Please make sure it's in your PATH, and try again.")


I didn't try to fix the file with v6.0 version (re.search('(17)', java_version):); So as a workaroud we will use the already compiled dataverse-5.14.war under Java 11 (link: https://github.com/IQSS/dataverse/releases/download/v5.14/dataverse-5.14.war).

Do you want us to create an issue ? Maybe you want to analyse and do a communication about this ?

If this can help, I still have the last version of unf-6.0.jar compiled under Java 11.

Ludovic DANIEL, INRAE team member of https://entrepot.recherche.data.gouv.fr/

o.be...@fz-juelich.de

unread,
Sep 14, 2023, 10:50:23 AM9/14/23
to Dataverse Users Community
Hi there!

As outlined during the containerization working group meeting, the solution we agreed to is releasing a version 6.0.1 to Maven Central which will be compatible with JDK8+.

That means, if you suffer from this problem, change the <version>6.0</version> to <version>6.0.1</version> in your fork and you're done!
Please note that it might take some time until the release is visible - the mirrors need to catch up.

Sorry for the inconvenience, hope this works for everyone (no way to take back a release on central anyway).

Best,
Oliver

o.be...@fz-juelich.de

unread,
Sep 14, 2023, 10:57:45 AM9/14/23
to Dataverse Users Community
If anyone wants to chat some more or discovers another problem, feel free to reach out via https://dataverse.zulipchat.com/#narrow/stream/379673-dev/topic/UNF.206.2E0.20breaks.20builds

Philip Durbin

unread,
Sep 19, 2023, 9:45:25 AM9/19/23
to dataverse...@googlegroups.com
I just released 6.0.1 of the UNF library to Maven Central.* Sorry to all the forks for breaking your build! Bumping your pom.xml to the new version should fix it.

Please let us know if you have any trouble.

Thanks,

Phil

* Oliver did all the real work: https://github.com/IQSS/UNF/issues/5#issuecomment-1725411589 (thanks!)


--
You received this message because you are subscribed to the Google Groups "Dataverse Users Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dataverse-commu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dataverse-community/fd0cce2d-21a0-4276-b08b-40d8cf75b327n%40googlegroups.com.


--
Reply all
Reply to author
Forward
0 new messages