MathGroup Archive 2006

[Date Index] [Thread Index] [Author Index]

Search the Archive

Java -> Mathematica -> Java

  • To: mathgroup at smc.vnet.net
  • Subject: [mg63729] Java -> Mathematica -> Java
  • From: "Zhao, Chunhua" <chunhua at purdue.edu>
  • Date: Thu, 12 Jan 2006 03:22:38 -0500 (EST)
  • Sender: owner-wri-mathgroup at wolfram.com

Hi,

I wonder if it is possible to call Mathematica in Java program, and then
the Mathematica code calls Java. For example,

ml = MathLinkFactory.createKernelLink("-linkmode launch -linkname
'c:\\program files\\wolfram
research\\mathematica\\5.1\\mathkernel.exe'");
String extra = "Needs[\"JLink`\"];" + "InstallJava[];" +
"AppendTo[$ExtraClassPath, " + '\u0022' + "F:\\Jar\" + '\u0022' + "];" +

		"class=LoadJavaClass[\"Functions\"];" +
"m=JavaNew[class];" + "m[setResult[106]];"; 
ml.evaluate(extra);

But it doesn't work for me. Any suggestions?

Thanks.
Chunhua Zhao


  • Prev by Date: Practical time limits with Solve[] and similar functions
  • Next by Date: Confusing behaviour with caching of evaluated expressions ?
  • Previous by thread: Re: Practical time limits with Solve[] and similar functions
  • Next by thread: Re: Java -> Mathematica -> Java