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/