2
$\begingroup$

I recently switched from Windows 7 to Mac OS X 10.9.2 for Mathematica development, and have set up Mathematica 9.0.2 and Wolfram Workbench 2 (running under Eclipse Kepler). Most everything works pretty well. However, on Windows, I would often work with notebooks by double-clicking them in Eclipse's "Package Explorer" view, which would open them in an already-running Mathematica front-end if there was one available.

This was a pretty convenient. It also doesn't seem to work on the Mac; when I double click a notebook, it launches a whole new front-end. This is less convenient. I can drag the little notebook icons onto the Mathematica icon in the Dock, but double-clicking would be nicer if I can make it work.

The obvious trick was to replace the path to the front-end executable with the path to open, the Mac OS command-line tool for opening documents in their associated applications. This didn't work even a little bit, with Eclipse complaining that the path to the executable was wrong.

$\endgroup$
2
  • $\begingroup$ Sorry if this is stating the obvious but if you are new to Mac the Mathematica application in your Applications folder is not the executable. Therefore if your path leads to it that would be why it fails. You need to right click on Mathematica and Show Package contents and find the executable from within those contents. $\endgroup$ Apr 10, 2014 at 21:53
  • $\begingroup$ Right, the path by default leads to the front end executable deep in the Mathematica.app directory. $\endgroup$
    – Pillsy
    Apr 11, 2014 at 1:21

1 Answer 1

2
$\begingroup$

I think I fixed this more-or-less by accident. The "fix", such as it was, has made reproducing the problem impossible, but I want to record it for posterity, and on the off chance somebody else has the problem.

What I did, quite without meaning to address my problem, was select a Mathematica NB file in the Package Explorer and select "Mathematica... > Run" with no Mathematica front end. After I did this, I found that whenever I double-click on a notebook in the "Package Explorer", the notebook will open in the currently running Mathematica application instead of starting a while new instance of the application. I quit Mathematica, and it kept working. I quit Eclipse, and it kept working.

I "Run" notebooks from Workbench much less frequently than I double-click on them, so it's pretty plausible that this is the first time I've run a notebook since switching to this computer. I can speculate that the first time you run a notebook from Eclipse, some initialization file somewhere is updated with the information needed for Eclipse to properly open notebooks in a currently running Mathematica front end, but speculation is all that is.

I think I'll forward this one to the Department of Mysterious Effects.

EDIT to add: When I posted this answer, I was almost disappointed that my issue was gone, because it meant I couldn't reproduce it and try to find out more. Ultimately, though, I was able to resign myself to spending more time working with Workbench and less time cursing at it.

Nonetheless, I was almost happy when it reappeared this morning. On the one hand, it meant that it wasn't actually fixed for good, but it at least gave me a chance to verify whether the steps I thought fixed it were the steps that actually fixed it. I double-clicked to open a notebook, and then "ran" a notebook, and that didn't actually work right; the second notebook opened in a new front end, and quitting both kernels and double-clicking two notebooks proceeded to open two front ends. However, once I started a front end by running a notebook with no other front ends open, the problem disappeared again.

I think this is definitely a bug, though one with a mostly painless workaround.

$\endgroup$

Your Answer

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

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