I have a problem running my test program on linux. I want to connect to mathematica kernel using java API. On windows, I put both jlink.jar and JLinkNativeLibrary.dll next to my executable file, let's say test.jar, and it works well. However, doing same on Linux machine, gives me error "cannot find the required native library named JLinkNativeLibrary". Please help me if you know. This is my code :
//String s = "-linkmode launch -linkname 'E:\\Software\\mathematica\\mathkernel.exe'"; // This is Windows version String s = "-linkmode launch -linkname math -mathlink "; ml = MathLinkFactory.createKernelLink(s); ml.connect(); ml.discardAnswer(); String answer = ml.evaluateToOutputForm("2 + 3",0); System.out.println(answer); Ps: Is this way to connect to math kernel on Linux is correct? I found it on Wolfram documents.