MathGroup Archive 2002

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

Search the Archive

Re: JLink problem

  • To: mathgroup at smc.vnet.net
  • Subject: [mg38513] Re: [mg38433] JLink problem
  • From: Todd Gayley <tgayley at wolfram.com>
  • Date: Fri, 20 Dec 2002 04:28:20 -0500 (EST)
  • Sender: owner-wri-mathgroup at wolfram.com

At 01:09 AM 12/15/02, Steven Hodgen wrote:
>I'm trying to get JLink working and am having some difficulties.  I need to
>change the CommandLine property for InstallJava[], and I wanted to set it up
>so it did it automatically.  In the Help it says to add a SetOptions[] to
>the init.m file.  I tried adding the code it suggests:
>
><<JLink`
>SetOptions[InstallJava, CommandLine->"mypath"]
>
>but it doesn't work.  If I add this line in an external editor, I get an
>error when I run Mathematica.  If I open the init.m file in Mathematica, it
>just doesn't stick.  The init.m file has a huge giant SetOptions in it.  In
>fact, that's all it is is one big SetOptions call.  Am I supposed to add my
>option to that call?  If so, how.  The format of the SetOptions[] in the
>init.m file looks very different.  Everything is enclosed in double quotes,
>including what looks like the property names.  Here's the first few lines:
>
>SetOptions[$FrontEnd,
>NotebookDirectory:>FrontEnd`FileName[{$RootDirectory, "C:", "Documents and \
>Settings", "steven", "Application Data", "Mathematica", "FrontEnd"}, \
>CharacterEncoding -> "WindowsANSI"],
>AutoOpenPalettes->{"BasicInput.nb", "AlgebraicManipulation.nb"},
>AutoOpenNotebooks->{},
>ScreenRectangle->{{0, 1024}, {0, 721}},
>NotebooksMenu->{
>
>If I need to add my option change in here, where should I put it.  This
>SetOptions[] is so complex it's hard to see where one thing starts and
>another end, especially since I'm so new to Mathematica.  Also, where do I
>put the "<<JLink`" statement?  If I add it at the top, it just dissapears
>next time I load Mathematica.


Steven,

You are looking at the wrong init.m file. That one is in the FrontEnd 
directory and it gets rewritten every time you launch Mathematica. You can 
find the kernel's init.m file in the <Mathematica 
directory>\Configuration\Kernel directory. This is the system-wide init.m 
file. If you only want to make changes on a per-user basis you can edit the 
init.m file in C:\Documents and Settings\steven\Application 
Data\Mathematica\Kernel. If there isn't one there yet, just create a new 
text file.

Whichever file you edit, just insert these two lines at the beginning of 
the file or at the end:

<<JLink`
SetOptions[InstallJava, CommandLine->"mypath"]


Todd Gayley
Wolfram Research



  • Prev by Date: Re: Integration bug
  • Next by Date: RE: portable issues with zip files
  • Previous by thread: JLink problem
  • Next by thread: How can i create a package?