Operating System - HP-UX
1821849 Members
3429 Online
109638 Solutions
New Discussion юеВ

#include "jni.h" is giving the error "Can't open include file"

 
SOLVED
Go to solution
Sukumar_2
New Member

#include "jni.h" is giving the error "Can't open include file"

Hi,
I am trying to write program for JNI (in HP-UX 10.20).
I am getting problem with include.
It is giving the following error
cpp: "c1.c", line 1: error 4036: Can't open include file 'jni.h'.

The code which i used is :
#include "jni.h"
#include
main()
{
printf("test");
}

Path i have set is
/opt/java/bin:/opt/java/include

$ cc c1.c
cpp: "c1.c", line 1: error 4036: Can't open include file 'jni.h'.

I hope i can get the reply.
Thanks,
Sukumar
The Road for success' is always under construction
3 REPLIES 3
Olav Baadsvik
Esteemed Contributor

Re: #include "jni.h" is giving the error "Can't open include file"

Hi,

Go to www.hp.com/go/java
and do a search for jni.h

This will give you a link to a document
"Using Java 2 JNI on HP-UX"

There you will find info on how to create
this include-file.

Regards
Olav

Steven Gillard_2
Honored Contributor
Solution

Re: #include "jni.h" is giving the error "Can't open include file"

Make sure you're compiling with the correct -I flags so that the compiler knows where to find the header files. The following example shows how a jni module should be compiled:

$ cc -Ae +u4 +z -c -D_HPUX -I/opt/java/include -I/opt/java/include/hp-ux cImpl.c

This comes from the following document, which may be of use to you:

http://www.hp.com/products1/unix/java/infolibrary/prog_guide/java1/JNI_java1.html

Regards,
Steve
Sukumar_2
New Member

Re: #include "jni.h" is giving the error "Can't open include file"

Thanks to all for the reply
-Sukumar
The Road for success' is always under construction