Arch Linux

Please read this before reporting a bug:
https://wiki.archlinux.org/index.php/Reporting_Bug_Guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

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 freswa (frederik) - Sunday, 13 September 2020, 13:50 GMT
Task Type Bug Report
Category Packages: Extra
Status Assigned
Assigned To Levente Polyak (anthraxx)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 0%
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

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.

Loading...