This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Invoke Java library from C/C++ Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Invoke Java library from C/C++" Watch "Invoke Java library from C/C++" New topic
Author

Invoke Java library from C/C++

George Lin
Ranch Hand

Joined: Jan 11, 2005
Posts: 125
Hello everyone,


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


Thanks in advance,
George
Joel McNary
Bartender

Joined: Aug 20, 2001
Posts: 1817

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.


Piscis Babelis est parvus, flavus, et hiridicus, et est probabiliter insolitissima raritas in toto mundo.
George Lin
Ranch Hand

Joined: Jan 11, 2005
Posts: 125
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 ]
 
 
subject: Invoke Java library from C/C++
 
Similar Threads
invoking c exe from java
how to invoke HttpRequest from a C code?
how to invoke jvm fro c++
Invoking java methods from C#
how to invoke outlook express and post the data into it using java or c++