FS#46884 - [java-runtime-common] should provide a symlink "default-java" pointing to "default"

Attached to Project: Arch Linux
Opened by Philipp Reinkemeier (philipp.reinkemeieroffis.de) - Tuesday, 27 October 2015, 07:49 GMT
Last edited by Buggy McBugFace (bugbot) - Saturday, 25 November 2023, 20:15 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Levente Polyak (anthraxx)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:
The FindJNI module of cmake is not able to locate JNI libraries.

Additional info:
- cmake version is 3.3.2-3
- jdk8-openjdk 8.u65-1 and jre8-openjdk 8.u65-1

Here is an excerpt of a cmake execution on a CMakeLists.txt file
containing "find_package(JNI REQUIRED)":

-- Found SWIG: /usr/bin/swig (found version "3.0.7")
-- Found Java: /usr/bin/java (found version "1.8.0.25")
CMake Error at /usr/share/cmake-3.3/Modules/FindPackageHandleStandardArgs.cmake:148 (message):
Could NOT find JNI (missing: JAVA_AWT_LIBRARY JAVA_JVM_LIBRARY)
Call Stack (most recent call first):
/usr/share/cmake-3.3/Modules/FindPackageHandleStandardArgs.cmake:388 (_FPHSA_FAILURE_MESSAGE)
cmake/FindJNI.cmake:255 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
CMakeLists.txt:111 (find_package)

Steps to reproduce:
- Create a new directory with a single file CMakeLists.txt somewhere with the following content:

project(FIND_JNI_TEST)
cmake_minimum_required(VERSION 2.8.11)
find_package(JNI REQUIRED)

- Execute the command "cmake ." in that directory.

Proposed fix (the reason why i filed this BUG report against java-runtime-common):

As per the file "/usr/share/cmake-3.3/Modules/FindJNI.cmake", the strategy of cmake to find the location of JNI libraries is to search certain well known installation locations. Unfortunately, none of these match the arch way of managing java installations. If beside the symlink "/usr/lib/jvm/default" the java-runtime-common package would just provide a symlink "/usr/lib/jvm/default-java" pointing to "/usr/lib/jvm/default", then cmake would be able to successfully locate the JNI libraries.

Expected outcome:
-- Found JNI: /usr/lib64/jvm/default-java/jre/lib/amd64/libjawt.so
-- Configuring done
-- Generating done
This task depends upon

Closed by  Buggy McBugFace (bugbot)
Saturday, 25 November 2023, 20:15 GMT
Reason for closing:  Moved
Additional comments about closing:  https://gitlab.archlinux.org/archlinux/p ackaging/packages/java-common/issues/1
Comment by Philipp Reinkemeier (philipp.reinkemeieroffis.de) - Tuesday, 27 October 2015, 07:52 GMT
Just to clarify: The proposal is NOT to provide the symlink "/usr/lib/jvm/default-java" INSTEAD of "/usr/lib/jvm/default", but just
"default-java -> default" in addition.
Comment by soloturn (soloturn) - Tuesday, 08 February 2022, 07:31 GMT
this can be closed, recent cmake contains:

> grep -i -C1 "arch linux" /usr/share/cmake/Modules/FindJNI.cmake
/usr/lib/jvm/default-java
# Arch Linux specific paths for default JVM
/usr/lib/jvm/default

Comment by Buggy McBugFace (bugbot) - Tuesday, 08 August 2023, 19:11 GMT
This is an automated comment as this bug is open for more then 2 years. Please reply if you still experience this bug otherwise this issue will be closed after 1 month.

Loading...