This week's book giveaway is in the Performance forum.
We're giving away four copies of The Java Performance Companion and have Charlie Hunt, Monica Beckwith, Poonam Parhar, & Bengt Rutisson on-line!
See this thread for details.
Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Invoke Java library from C/C++

 
George Lin
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello everyone,


Are there any approaches to invoke Java libraries from C/C++?


Thanks in advance,
George
 
Joel McNary
Bartender
Posts: 1840
Eclipse IDE Java Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes; do a google search for JNI (Java Native Interface). It allows Java to call C/C++ code, and (for your purposes) it allows C/C++ code to call Java.
 
George Lin
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Joel,


Originally posted by Joel McNary:
Yes; do a google search for JNI (Java Native Interface). It allows Java to call C/C++ code, and (for your purposes) it allows C/C++ code to call Java.


I only know we can use JNI to invoke native libraries from Java and I have never used JNI to invoke Java libraries from native applications (C/C++ programs). I am going to look through JNI as you recommended.

Another question, do you know how JNI is implemented internally by JVM?


regards,
George
[ April 04, 2005: Message edited by: George Lin ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic