I'm using Ant script in Eclipse using Workbench on Windows 7. I've used multiple versions but the issue persists. Essentially, I define multiple targets and call them in sequence like this:

Multiple targets (# below is 1, 2, etc.):

<target name="target-#">
<mathematica exe="${mathExe}" ...mathematica operations </mathematica> </target>  Calling targets: <target name="callingTarget"> <antcall targe="target-1"> <antcall targe="target-2"> </target>  Individual target can all run smoothly. But if called in sequence, the second one would fail with this message: [mathematica] Fatal error: cannot find the required native library named JLinkNativeLibrary. Searching of this error points to CLASSPATH, which I tried various ways including hard coding in the Ant script and setting in Environment. However, it would work fine when using "depends": <target name="callingTarget" depends="target-1,target-2"> </target>  I guess it has something to do with how Mathematica workbench loads/resets JLink. A further twist is that if the above "target-1" is docbuild (target "main" in docbuild.xml) provided by Workbench, even "depends" gives the same error when "target-2" starts. I echo'ed "\${mathExe}" and "\${jlinkpath}" in each target and they were still defined correctly. I'd appreciate your help or suggestion on where the loading issues might be.