Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to get LinkSnooper up and working on a Windows 7 machine to monitor the interaction between the Mathematica front end and MathLink. I'm facing great troubles following the instructions here. Namely, my arguments to MLOpen are as follows:

-LinkMode Launch -LinkName "'C:/Program Files/Wolfram Research/Mathematica/9.0/SystemFiles/Java/Windows-x86-64/javaw' -classpath \"C:/Program Files/Wolfram Research/Mathematica/9.0/SystemFiles/Links/JLink/JLink.jar\" com.wolfram.jlink.util.LinkSnooper -kernelname 'C:/Program Files/Wolfram Research/Mathematica/9.0/mathkernel.exe'"

and when loading the kernel, a file system browser pops up and asks me to select a MathLink program to run. Anyone got this working on a windows machine and perhaps have some suggestions?

share|improve this question
up vote 9 down vote accepted

One problem is that your path to javaw is wrong (you forgot the bin dir). But that quoting style is very hard to make work, and possibly flat-out wrong (I swear that example in the documentation worked about nine years ago when I wrote it, but I cannot seem to make anything like it work now; my apologies).

The correct way is to invert your single and double quotes, meaning use a single quote around the whole outer -LinkName part, and then use unescaped double quotes for pathnames within it. Like this:

-LinkMode Launch -LinkName '"C:/Program Files/Wolfram Research/Mathematica/9.0/SystemFiles/Java/Windows-x86-64/bin/javaw.exe" -classpath "C:/Program Files/Wolfram Research/Mathematica/9.0/SystemFiles/Links/JLink/JLink.jar" com.wolfram.jlink.util.LinkSnooper -kernelname "C:/Program Files/Wolfram Research/Mathematica/9.0/mathkernel.exe"'
share|improve this answer
Wow, finally I found this. I was wondering what is wrong. :) p.s. I had to use -cp instead of -classpath to make it work. – Kuba Oct 30 '14 at 11:35
@Todd Unfortunately, this seems not to work on Windows 32 bits systemes with Mathematica 10, see here. – Fred Simons Nov 24 '14 at 14:32

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.