maintainer-feedback requested: [Bug 266086] devel/cmake: cmake fails to find Java 11

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Sun Aug 28 18:22:36 BST 2022


Bugzilla Automation <bugzilla at FreeBSD.org> has asked freebsd-kde (Team)
<kde at FreeBSD.org> for maintainer-feedback:
Bug 266086: devel/cmake: cmake fails to find Java 11
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=266086



--- Description ---
This CMakeLists.txt:

> cmake_minimum_required(VERSION 3.15)
> find_package(Java 11 REQUIRED COMPONENTS Runtime)

fails to find Java 11:
> CMake Error at
/usr/local/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:230
(message):
>   Could NOT find Java: Found unsuitable version "1.8.0.342", but required is
>   at least "11" (found /usr/local/bin/java, found components: Runtime)
> Call Stack (most recent call first):
>   /usr/local/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:592
(_FPHSA_FAILURE_MESSAGE)
>   /usr/local/share/cmake/Modules/FindJava.cmake:309
(find_package_handle_standard_args)
>   CMakeLists.txt:4 (find_package)

when several Java versions are installed:
> $ pkg info | grep -i openjdk
> bootstrap-openjdk17-17.0.1.12.1 Java Development Kit 17
> openjdk11-11.0.16+8.1 	 Java Development Kit 11
> openjdk17-17.0.4+8.1		 Java Development Kit 17
> openjdk8-8.342.07.1		 Java Development Kit 8


cmake-3.23.3
FreeBSD 13.1


More information about the kde-freebsd mailing list