bytedeco / javacpp

The missing bridge between Java and native C++
Other
4.43k stars 576 forks source link

'jni.h' file not found #715

Closed shuaidan0412 closed 9 months ago

shuaidan0412 commented 9 months ago

'jni.h' file not found mac: 12.5

saudet commented 9 months ago

You'll need to install the JDK

saudet commented 9 months ago

Duplicate of https://github.com/bytedeco/javacpp-presets/issues/1417

shuaidan0412 commented 9 months ago

have jdk.

` evindeMacBook-Air:include devin$ pwd /Library/Java/JavaVirtualMachines/jdk1.8.0_191.jdk/Contents/Home/include devindeMacBook-Air:include devin$ ll total 384 drwxr-xr-x 9 root wheel 288 10 6 2018 ./ drwxr-xr-x 15 root wheel 480 10 12 16:52 ../ -rw-r--r-- 1 root wheel 20128 10 6 2018 classfile_constants.h drwxr-xr-x 4 root wheel 128 10 6 2018 darwin/ -rw-r--r-- 1 root wheel 8690 10 6 2018 jawt.h -rw-r--r-- 1 root wheel 6407 10 6 2018 jdwpTransport.h -rw-r--r-- 1 root wheel 73701 10 6 2018 jni.h -rw-r--r-- 1 root wheel 77428 10 6 2018 jvmti.h -rw-r--r-- 1 root wheel 3774 10 6 2018 jvmticmlr.h devindeMacBook-Air:include devin$ pwd /Library/Java/JavaVirtualMachines/jdk1.8.0_191.jdk/Contents/Home/include devindeMacBook-Air:include devin$ echo $JAVA_HOME /Library/Java/JavaVirtualMachines/jdk1.8.0_191.jdk/Contents/Home

`

saudet commented 9 months ago

What does System.getProperty("java.home") returns?

shuaidan0412 commented 9 months ago

java.home return "/Library/Java/JavaVirtualMachines/jdk1.8.0_191.jdk/Contents/Home/jre"

saudet commented 9 months ago

That means you're using the JRE. That won't work. Like I said, you need to use the JDK.