Arch Linux

Please read this before reporting a bug:

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!

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

Attached to Project: Arch Linux
Opened by Philipp Reinkemeier ( - 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


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 "")
CMake Error at /usr/share/cmake-3.3/Modules/FindPackageHandleStandardArgs.cmake:148 (message):
Call Stack (most recent call first):
/usr/share/cmake-3.3/Modules/FindPackageHandleStandardArgs.cmake:388 (_FPHSA_FAILURE_MESSAGE)
CMakeLists.txt:111 (find_package)

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

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/
-- Configuring done
-- Generating done
This task depends upon

Comment by Philipp Reinkemeier ( - 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
# Arch Linux specific paths for default JVM