Operating System - HP-UX
1753722 Members
4626 Online
108799 Solutions
New Discussion юеВ

Re: JNI - calling JAVA from C program.

 
Haribaskar
Occasional Advisor

JNI - calling JAVA from C program.

I am trying to call java method from a native code like Java.
I took the example from JAVA site and tried to execute .
The executing command and the error I got is :

JNI :>cc -I /opt/java1.4/include/hp-ux -I /opt/java1.4/include -L/opt/java1.4/jre/lib/PA_RISC -ljava invoke.c
cc: "invoke.c", line 36: warning 604: Pointers are not assignment-compatible.
cc: "invoke.c", line 36: warning 563: Argument #2 is not the correct type.
/usr/ccs/bin/ld: Can't open /CLO/Components/JAVA_12/Src/build/HP_UX/lib/PA_RISC/server/libjvm.sl
/usr/ccs/bin/ld: No such file or directory


To over cme this we have given in the .profile file :
export SHLIB_PATH=/opt/java1.4/jre/lib/PA_RISC/server:/opt/java1.4/jre/li
b/PA_RISC
where we have the libjvm.sl and libjava.sl

Even then it is referring to /CLO/Components/JAVA_12/Src/build/HP_UX/lib/PA_RISC/server/libjvm.sl
Can you please shed some light on how to overcome this problem.
Thanks
Hari Baskar.
2 REPLIES 2
sunport
New Member

Re: JNI - calling JAVA from C program.

Hi Hari,

Couple of quick checks:
1. Do your shared libraries have an execute bit on?

2. What OS are you on? Don't you want to link to PA-RISC2.0 instead?

cheers
borax

That's Mr Sunport to you, Sir! :)
lylesh
New Member

Re: JNI - calling JAVA from C program.

Hi Hari,

Even I am facing a similar problem, can you please let me know about the the solution for this. please mail me at lylesh@yahoo.com, I really need a help on this

Thanks,

Lylesh