• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

JNI

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Sheriff
Posts: 22856
132
Eclipse IDE Spring Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 22856
132
Eclipse IDE Spring Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic