MathGroup Archive 2005

[Date Index] [Thread Index] [Author Index]

Search the Archive


  • To: mathgroup at
  • Subject: [mg53975] JLink
  • From: "D.D. \"Skip\" Snyder" <SkipS at>
  • Date: Sat, 5 Feb 2005 03:17:28 -0500 (EST)
  • Sender: owner-wri-mathgroup at

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 which is located in the directory

C:\Program Files\Wolfram

1.  I am using NetBeans 3.6 as an IDE and, after setting the working
directory to
	C:\Program Files\Wolfram
and the classpath to
	C:\Program Files\Wolfram Research\Mathematica\5.1\AddOns\JLink\JLink.jar will compile and execute correctly.

2.  If I now move the to another directory say
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(
        at Method)
        at java.lang.ClassLoader.loadClass(
        at sun.misc.Launcher$AppClassLoader.loadClass(
        at java.lang.ClassLoader.loadClass(
        at java.lang.ClassLoader.loadClassInternal(
Exception in thread "main"

It appears that these exceptions are the result of an inability to find the

"C:\Program Files\Wolfram
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

D.D. "Skip" Snyder
Blackhawk GeoServices, Inc
671 Crescent Ct.
Grand Junction, CO 81505
(970) 254-0330
(970) 261-5825 (Cell)

  • Prev by Date: Few notes
  • Next by Date: Re: Mathematica
  • Previous by thread: Few notes
  • Next by thread: Re: JLink