views:

156

answers:

1

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?

A: 

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

Raghuram
Thanks, it worked like a charm..
dapper