I'm currently developing on a project written in Java. We have a bunch of algorithms written in C/C++ (at least a couple hundred) that need to be incorporated in our project. Our two options are to use JNI to call this code, or to rewrite all the algorithms in Java.
I am aware of the consequences of using JNI, it can open up a whole new set of problems, which is why rewriting all the code in Java is even being considered. But the thought of rewriting it seems...wrong. The algorithms have been tested and work as far as I know, they're just in the wrong language.
In this situation, would JNI make this task easy? Or would it cause more headache than rewriting the code in Java would?
EDIT #1: Related Question - Usefulness of JNI
EDIT #2: FYI - Our Java project is not meant to be portable in any way. That might eliminate one of the downsides of JNI in that it supposedly reduces portability.
The simple answer is, if the code is going to be called a lot AND performance matters then convert it over to Java.
The more complex answers are:
I would do the following:
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments