If you have the source code, why don't you just change it to suit you rather than trying to restricted functionality using Java. Also how are you 'running' the C++ code. Are you compiling it down...