Skip to Main Content

Java HotSpot Virtual Machine

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Where is jni.h

843829Jun 19 2001 — edited Aug 28 2001
Hi

I was doing a tutorial by Beth Stearns at: http://java.sun.com/docs/books/tutorial/native1.1/index.html

I compiled my java file using javah -jni HelloWorld. which works fine. then i wrote the C file with the following code:

#include <jni.h>
#include "HelloWorld.h"
#include <stdio.h>

JNIEXPORT void JNICALL
Java_HelloWorld_displayHelloWorld(JNIEnv *env, jobject obj)
{
printf("Hello world!\n");
return;
}

However when i compile this file i get the error that it cannot find the 'jni.h' and 'HelloWorld.h' files.

when i looked under the directory i can find the 'HelloWorld.h' file but i cannot find the 'jni.h' file.

so really i have 2 questions:
why cannot the compiler find the HelloWorld.h file

and where is jni.h located.

regards
Qasim
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 25 2001
Added on Jun 19 2001
5 comments
956 views