JLink
- To: mathgroup at smc.vnet.net
- Subject: [mg53975] JLink
- From: "D.D. \"Skip\" Snyder" <SkipS at bresnan.net>
- Date: Sat, 5 Feb 2005 03:17:28 -0500 (EST)
- Sender: owner-wri-mathgroup at wolfram.com
I'm trying to exploit the capabilities of JLink to write Java code that uses mathkernel.exe as a server. I am testing the example program SampleProgram.java which is located in the directory C:\Program Files\Wolfram Research\Mathematica\5.1\AddOns\JLink\Examples\Part2 1. I am using NetBeans 3.6 as an IDE and, after setting the working directory to C:\Program Files\Wolfram Research\Mathematica\5.1\AddOns\JLink\Examples\Part2, and the classpath to C:\Program Files\Wolfram Research\Mathematica\5.1\AddOns\JLink\JLink.jar SampleProgram.java will compile and execute correctly. 2. If I now move the SampleProgram.java to another directory say E:\AOL12_SRC\JLink_Examples\Part2 and change the working directory to accommodate that change, I can compile OK but when I try to execute I get the following exceptions: java.lang.NoClassDefFoundError: JLink_Examples/Part2/SampleProgram (wrong name: SampleProgram) at java.lang.ClassLoader.defineClass0(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:537) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:123) at java.net.URLClassLoader.defineClass(URLClassLoader.java:251) at java.net.URLClassLoader.access$100(URLClassLoader.java:55) at java.net.URLClassLoader$1.run(URLClassLoader.java:194) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:187) at java.lang.ClassLoader.loadClass(ClassLoader.java:289) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274) at java.lang.ClassLoader.loadClass(ClassLoader.java:235) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302) Exception in thread "main" It appears that these exceptions are the result of an inability to find the file "C:\Program Files\Wolfram Research\Mathematica\5.1\AddOns\JLink\SystemFiles\Libraries\Windows\JLinkNat iveLibrary.dll" which resides in its original installation directory. I have tried to register the dll with no luck. (I get a regsvr32 error saying that it cannot find an entry point.) I have also tried copying JLinkNativeLibrary.dll into the new working directory, again with no luck. Can anyone educate me on the finepoints of maintaining connections with JLinkNativeLibrary.dll? D.D. "Skip" Snyder Blackhawk GeoServices, Inc 671 Crescent Ct. Grand Junction, CO 81505 (970) 254-0330 (970) 261-5825 (Cell)