Re: JLink

*To*: mathgroup at smc.vnet.net*Subject*: [mg82104] Re: JLink*From*: John Jowett <John.M.Jowett at gmail.com>*Date*: Fri, 12 Oct 2007 02:55:33 -0400 (EDT)*References*: <200708230457.AAA08711@smc.vnet.net><far9so$4ci$1@smc.vnet.net>

Before my last post appeared, I found the answer myself. Change "java" to "javaw" in ReinstallJava[CommandLine->"C:\\Program Files\\Java\\jre1.6.0_02\\bin\ \\javaw"] However I can claim that I was misled by the page JLink/tutorial/ CallingJavaFromMathematica in the Mathematica 6 Help system, which explicitly suggests using ReinstallJava[CommandLine -> "d:\\full\\path\\to\\java.exe"] This should be corrected, I think. John Jowett On Aug 26, 9:25 am, Todd Gayley <tgay... at wolfram.com> wrote: > At 11:57 PM 8/22/2007, dh wrote: > > > > > > >Hello, > > >Mathematica 6 comes with an outdated Java. Therefore, it may be > > >necessary to use a newer version. A clumsy solution is to change the > > >Java in the installation. However, there was a better method that worked > > >before v6: > > >InstallJava takes an option "CommandLine" that specifies a command line > > >to start Java. In version 6 this does no more work correctly. If I say: > > >InstallJava[CommandLine->"name of new java"] > > >the old Java of mathematica is loaded, despite the option. However, if I > > >prevent mathematica to find the java executable by renaming the > > >corresponding folder, the correct java is now loaded. > > >Daniel > > Daniel, > > Java is now launched at startup time, so when you call > InstallJava[CommandLine->"..."] J/Link just returns the current Java > link. What you need to do is force Java to restart with your desired options: > > ReinstallJava[CommandLine->"..."] > > Incidentally, the pre-launch of Java has been anticipated for a long > time, so the J/Link User Guide has been warning about it for several > years: "Programmers should not assume that they have the ability to > control the launch of the Java runtime, as it might already be > running. If for some reason you absolutely must apply options to > control the launch of the Java runtime, useReinstallJavainstead of > InstallJava." > > --Todd- Hide quoted text - > > - Show quoted text -