• Post Reply Bookmark Topic Watch Topic
  • New Topic

JNI

 
Sindhura Lakshmi
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,

I am reading about JNI and found that for using a C library we need to make some modifications in the C program also .Is there a way out to use the C program without making any modifications to it using JNI.
 
Rob Spoor
Sheriff
Posts: 20822
68
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Write a wrapper in C. Basically this C wrapper forms a bridge between Java and the existing C application. The wrapper uses the JNI method names etc, and calls the needed functions in the C application.
 
Sindhura Lakshmi
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I dont have any idea about C ..I want to use the C application without making any changes, from my JNI class .Is it possible to do tat?
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, JNI uses C, so you will have to learn at least a few things about C. Start here: http://java.sun.com/developer/onlineTraining/Programming/JDCBook/jni.html
 
Rob Spoor
Sheriff
Posts: 20822
68
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ulf Dittmer wrote:Well, JNI uses C

Not necessarily. I myself use Delphi for my Windows JNI coding, simply because I can't get MinGW to link the COM libraries properly. But C is the most used JNI language, that much is true.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!