是否有可能从Java运行C源代码code? [英] Is it possible to run C source code from Java?
问题描述
现在我有一些C源$ C $ CS,我想在我的Java应用程序中使用它。
我需要执行的C源$ C $ C,并取回结果我的Java应用程序。而不是重新编写所有的C源$ C $ C到Java,我怎么能重复使用的C源$ C $ C在我的Java应用程序?
Now I have some C source codes, I would like to use it in my java application. I need to execute the C source code, and get back the result to my java application. Instead of re-write all the C source code to java, how can I reuse the C's source code in my java application?
推荐答案
看看 Java本地接口。
Java本机接口(JNI)是一种编程框架,
使在Java虚拟机(JVM)的调用Java code运行和
由具体到一个本地应用程序(程序调用
硬件和操作系统平台)和写在其它库
语言,如C,C ++和汇编。
The Java Native Interface (JNI) is a programming framework that enables Java code running in a Java Virtual Machine (JVM) to call and to be called by native applications (programs specific to a hardware and operating system platform) and libraries written in other languages such as C, C++ and assembly.
这篇关于是否有可能从Java运行C源代码code?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!