Compile jinterface with --release 11 or lower
Task Info (Flyspray) | |
---|---|
Opened By | Kauron (kauron) |
Task ID | 80316 |
Type | Bug Report |
Project | Arch Linux |
Category | Packages: Extra |
Version | None |
OS | All |
Opened | 2023-11-21 17:49:48 UTC |
Status | Assigned |
Assignee | Alexander F. Rødseth (xyproto) |
Details
Description:
Erlang includes jinterface, a Java interface to execute remote calls on Erlang servers. This package includes a compiled version (/usr/lib/erlang/lib/jinterface-*/priv/OtpErlang.jar). However, this jar has been compiled with the latest version of Java (21) and without any compatibility settings, and thus cannot be run with older version of Java, including versions packaged and supported by Arch (8, 11, 17).
Proposed solution:
The solution would be to insert --release NUM
to compile with backwards compatibility. Ideally, NUM=8, but that's deprecated in Java 21. I've been searching for the place to insert this flag in jinterface's source code, but I can't find the compilation step, all I can find is the jar creation at lib/jinterface-*/java_src/com/ericsson/otp/erlang/Makefile.
Another solution is to add a makedepends on Java 8, so that the build environment builds for Java 8 by default, and the resulting jar is valid for all versions of Java packaged in Arch.
Additional info:
- Package version: erlang 26.1.1-1
Steps to reproduce:
- Install Erlang and Java 11 (pacman -S erlang jdk11-openjdk)
- Set the Java version to 11 (archlinux-java set java-11-openjdk)
- Run any application that uses jinterface, dummy command: java -cp /usr/lib/erlang/lib/jinterface-*/priv/OtpErlang.jar com.ericsson.otp.erlang.OtpErlangBinary
- The output indicates that the jar has been compiled for a newer version of Java: java.lang.UnsupportedClassVersionError: com/ericsson/otp/erlang/OtpErlangBinary has been compiled by a more recent version of the Java Runtime (class file version 65.0), this version of the Java Runtime only recognizes class file versions up to 55.0