On e.g. debian we can:
$ sudo apt-get install openjdk-21-jdk cmake g++
$ $ ./makerun.sh
-- The CXX compiler identification is GNU 13.3.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found Java: /usr/lib/jvm/java-21-openjdk-amd64/bin/java (found version "21.0.9") found components: Development
-- Found JNI: /usr/lib/jvm/java-21-openjdk-amd64/include found components: AWT JVM
-- Configuring done (1.3s)
-- Generating done (0.0s)
-- Build files have been written to: /home/bjorningvar/vc/HelloJNI.java/build
[ 33%] Building CXX object CMakeFiles/hello.dir/HelloJNIImpl.cpp.o
[ 66%] Linking CXX shared library libhello.so
[100%] Built target hello
[DEBUG] Releasing Dave
Hello, Dave