Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

does JNI make plateform independent code?  RSS feed

 
ankur rathi
Ranch Hand
Posts: 3830
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If I implement JNI (calls other languages' method) in my Java code, is still my Java code plateform independent???

Thanks.
[ May 17, 2006: Message edited by: rathi ji ]
 
Peter Chase
Ranch Hand
Posts: 1970
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to build the JNI libraries for each platform you plan to use. Depending on what your JNI libraries are doing, you may be able to get away with a single set of other-language source code, or you may need that source code to vary according to platform. For instance, if you were just calling C or C++ standard library functions, one set of C/C++ source code would work on any platforms. But if you were calling desktop integration libraries, for instance, you'd need platform-specific code.

Once you have implemented the JNI libraries on all necessary platforms, your single set of Java source code can run on all those platforms.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!