should provide a symlink "default-java" pointing to "default"
Task Info (Flyspray) | |
---|---|
Opened By | Philipp Reinkemeier (philipp.reinkemeieroffis.de) |
Task ID | 46884 |
Type | Bug Report |
Project | Arch Linux |
Category | Packages: Extra |
Version | None |
OS | All |
Opened | 2015-10-27 07:49:44 UTC |
Status | Assigned |
Assignee | Levente Polyak (anthraxx) |
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