With the help of MathWorks support, I've found the answer. Here is how to make JDDE work with Matlab 2012b, without admin privileges:
- Download and unpack JDDE files (DLLs and JAR) into some folder. Let's say it's
$path-to-jdde$\
. - In Matlab, type
prefdir
. Open the resulting directory and create two files there,javaclasspath.txt
andjavalibrarypath.txt
. - In javaclasspath.txt, add
$path-to-jdde$\pretty-tools-JDDE-2.0.3.jar
. - In javalibrarypath.txt, add
$path-to-jdde$\
. - Restart Matlab.
Now call ddeConv = com.pretty_tools.dde.client.DDEClientConversation;
and start using the created object as described in JavaDoc. E.g. to connect to Zemax, run Zemax and then in call ddeConv.connect('Zemax', 'abc')
.
Step 2 above can only be done starting Matlab version R2012b. With an older version, if you have the write rights on the Matlab installation directory, you should be able to replace step 2 by editing the files librarypath.txt and classpath.txt in $MATLABROOT$\toolbox\local. I could not verify it so if you confirm it please let me know in the comment below.