2

I want to use JNI with Play framework, finally following this project https://github.com/ezh/HelloWorldJNIwithRegisterNatives I managed to build the scala wrappers and compile the code, the library generated is working, but I need to change the java.library.path to point also to target/so where de library is generated, if not I need to copy manually it to one folder that is pointed by the java.library.path

Thanks in advance

1 Answer 1

1

Maybe this is not your perfect solution but, if you want to execute some C/C++ source code from your backend (PlayFramework) I suggest you to compile your C/C++ source code giving an interface that you can call from shell.

Mkyong have a tutorial to execute shell commands from Java code: http://www.mkyong.com/java/how-to-execute-shell-command-from-java/

p = Runtime.getRuntime().exec("host -t a " + domain);
p.waitFor();

BufferedReader reader = 
     new BufferedReader(new InputStreamReader(p.getInputStream()));

String line = "";           
while ((line = reader.readLine())!= null) {
sb.append(line + "\n");
}
Sign up to request clarification or add additional context in comments.

1 Comment

Thanks, this is a good patch for the moment, so I up voted your solution. But it is not the answer that I'm looking for. Cheers!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.