java - Encapsulate excutable -
i have binary executable have source code in c++. need use in ways in java code. planing wrap class in java, code call class instead of calling executable directly. similar how .net wraps old com component. since new java, wondering if there better way solve it.
it depends on "certain ways" want use it.
if want call methods directly, (probably) need learn jni. there weird com <-> java things, or @ least there used be.
if want more or less "pipe" data , out of executable, similar unix commands, need @ runtime.exec(), or newer (and better) processbuilder. direct use of runtime.exec() challenging, so, if want, search libraries support it, or example code.
(edit added in response op's comment) running shell command, you'll want @ runtime.exec() or processbuilder. here links:
Comments
Post a Comment