楼上:不是这个意思。看看下面吧。 http://java.sun.com/docs/books/tutorial/native1.1/concepts/index.htmlProgrammers use the JNI to write native methods to handle those situations when an application cannot be written entirely in the Java programming language. For example, you may need to use native methods and the JNI in the following situations: 1。The standard Java class library may not support the platform-dependent features needed by your application. 2。You may already have a library or application written in another programming language and you wish to make it accessible to Java applications. 3。You may want to implement a small portion of time-critical code in a lower-level programming language, such as assembly, and then have your Java application call these functions.
在Linux下 生成 *.so 放到指定目录
好像使用 JNI 来实现Java对C的调用 , 当然这跟调用C写的动态连接库会有
差别 ,不过我想是差不多的。
样样野不要那么绝对,举个例子,在linux下,包含awt的java程序如何在没有x-win的环境下运行?你能做的到吗。所以一个办法是用jni调用C写的library去完成awt的功能。
http://java.sun.com/docs/books/tutorial/native1.1/concepts/index.htmlProgrammers use the JNI to write native methods to handle those situations when an application cannot be written entirely in the Java programming language. For example, you may need to use native methods and the JNI in the following situations: 1。The standard Java class library may not support the platform-dependent features needed by your application.
2。You may already have a library or application written in another programming language and you wish to make it accessible to Java applications.
3。You may want to implement a small portion of time-critical code in a lower-level programming language, such as assembly, and then have your Java application call these functions.
java<->jni<->JNI interface 'DLL <->native DLL
>这是两回事……难道他在WINDOWS下面的动态库能在LINUX下面用? 在Windows上的动态库是用C写的,几乎不需修改就可以在Linux上重新生成.so。所以这里还是想用Java的跨平台性的。