4paradigm / 4paradigm/OpenMLDB

higher cmake may failed on find jni in required mode

Open
#2,883 3 comments 0 reactions 1 assignee Claimed by @vagetablechicken View on GitHub
bug build
Dominant language
C++
Stars
1.7k
Forks
331
Avg merge
12d 12h
Merged PRs (30d)
1

Description

In higher cmake e.g. 3.24.1 https://github.com/Kitware/CMake/blob/v3.24.1/Modules/FindJNI.cmake
FindJNI will find the components, jvm and jawt, it's set by
https://github.com/Kitware/CMake/blob/8c7ac278cd5af00e0f6ec661635921af40ae3839/Modules/FindJNI.cmake#L119-L120

If we can find the Main JNI target, but can't find jvm and jawt(some weird env), it'll fatal too.
```
Could NOT find JNI (missing: AWT)
```

`set(JNI_FIND_COMPONENTS )` doesn't work.
If find missing components, `JNI_FOUND` will be FALSE.

Contributor guide

Open the contributing guide

Research direction

Look at the CMake configuration for JNI, likely in CMakeLists.txt or related build scripts. Understand how FindJNI.cmake works in CMake 3.24.1 and later. The issue is that missing components (jvm, jawt) cause JNI_FOUND to be false even if the main JNI target is found. Check the environment and see if setting JNI_FIND_COMPONENTS can be adjusted or if the find_package call needs modification. Test the build with a higher CMake version to reproduce the error.

Written by the indexing model from the issue text.

Assessment

Tech stack
cmake
Domain
build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.