Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot open include file "jni.h", No such file or directory exists

I am implementing the simple JNI example , as given in

http://java.sun.com/docs/books/jni/html/start.html

At the second last step, when the C source is being compiled,

the following command is used:

C:\Program Files\Java\jdk1.6.0_21> cl -IC:\Program Files\Java\jdk1.6.0_21\include -IC:\Program Files\Java\jdl1.6.0_21\include\win32 -MD -LD Callbacks.c -FeCallbacks.dll

I get the following error:

"Cannot open include file "jni.h", No such file or directory exists."

But jni.h does exist in java/jdk1.6.0_21/include folder.

How can I remove this error?

like image 593
dapper Avatar asked Aug 11 '10 06:08

dapper


1 Answers

Since the path contain spaces u need to enclose the path inside "" like cl -IC:\Program Files\Java\jdk1.6.0_21\includ e -I"C:\Program Files\Java\jdl1.6.0_21\include\win32" -MD -LD Callbacks.c -FeCallb acks.dll

like image 104
Raghuram Avatar answered Dec 31 '22 18:12

Raghuram