compiler for using JNI on Linux
2 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   S_Shreya
Posted On:   Sunday, June 10, 2001 09:38 AM

Hi,
For JNI on windows we use VC++ compiler. I want to know to use JNI
on Linux which compiler has to be used?
Thank you
girija

Re: compiler for using JNI on Linux

Posted By:   Anshul_Malvi  
Posted On:   Saturday, June 16, 2001 03:50 PM

Sorry I didnt answer the question you asked.
Anyway, use gcc to compile your native code.
cheers
.a

Re: compiler for using JNI on Linux

Posted By:   Anshul_Malvi  
Posted On:   Saturday, June 16, 2001 03:49 PM

hello girija,

I am using redhat 7.1 and am using Sun's JDK1.2.2 to compile my native code. BEWARE, if you want to embed a JVM in your native code, you will have to include the correct libraries. I learnt the hard way. Anyway here are the libraries you need to include while creating an executable or shared library.
Use the following compile options:

gcc -L /java/jdk1.2.2/jre/lib/i386/classic -L /java/jdk1.2.2/jre/lib/i386/native_threads -ljvm -lhpi -lpthread test.c


Also set the $LD_LIBRARY_PATH env. variable to the directories mentioned above. This will help the C executable load the shared libraries dynamically.
This should work.
good luck
.a
About | Sitemap | Contact