A popup window always show after kernelLink.close(); And this only happen after expression evaluated as graph. Such as evaluateToTypeset enter image description here

I got the suggestion from JLinkUserGuide in 'Graphics and Typeset Output' chapter bellowed:

It is very important to note that you execute CloseFrontEnd[] before closing the link to the kernel. This is essential to prevent the front end from quitting in circumstances where it should not~specifically, if an already-running copy was used and the user has open documents.

But this does not work. This's my code of init KernelLink

System.setProperty("com.wolfram.jlink.libdir", "/usr/local/Wolfram/Mathematica/10.0/SystemFiles/Links/JLink/SystemFiles/Libraries/Linux-x86-64");
KernelLink kernelLink = MathLinkFactory.createKernelLink("-linkmode launch -linkname /usr/local/Wolfram/Mathematica/10.0/Executables/MathKernel -mathlink");

Close KernelLink

kernelLink.evaluateToOutputForm("CloseFrontEnd[]", 0);
  • $\begingroup$ This doesn't help you, but I get this message all the time when I interrupt Mathematica when running from the console. Clicking "yes" seems to work without causing any negative side effects. $\endgroup$
    – user1722
    Feb 4 '16 at 21:02
  • $\begingroup$ @barrycarter I am worrying about any negative effect when I deploy this application in linux server. Because there's no UI to let me click 'yes' $\endgroup$
    – Michael
    Feb 5 '16 at 3:14
  • $\begingroup$ I don't have a way to test this, but would Quiet suppress the popup? $\endgroup$
    – Fred Kline
    Mar 8 '16 at 13:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.