ImageJ.exe launcher on Windows x64?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

ImageJ.exe launcher on Windows x64?

Hoover, Karl
Hi Wayne et al.,

I've got the Micromanager plugin and its components running fine on Windows 7 x64 but I still have an iron-resistant wrinkle with the ImageJ.exe launcher. We package ImageJ with Micromanager but we don't package Java. Therefore we let the ImageJ.exe launcher modify the ImageJ.cfg.  When ImageJ launches on an x64 machine with both 32 bit and 64 bit java machine installed  - the usual case -  it writes the path of the 32 bit java machine into the ImageJ.cfg irrespective of the value of JAVA_HOME.  Since Micromanager includes native (C++) binaries compiled for either Win32 or x64 we need to run on the appropriate java machine, else the results are quite unpleasant and will be quite bewildering to the end user. Has anyone else encountered this problem? Perhaps I'm missing something obvious?

Thanks in advance,

Karl Hoover
Reply | Threaded
Open this post in threaded view
|

Re: ImageJ.exe launcher on Windows x64?

Unruh, Jay-2
For complex platforms, I would suggest launching ImageJ via either a batch file or a custom executable.  Most end users that want customized options like different memory or proxy settings are willing to learn how to edit a batch file for customizations.  Anyway, here is a little script similar to what you want.

start c:\PROGRA~1\Java\jre1.6.0_07\bin\javaw -Xmx1024m -cp ij.jar ij.ImageJ

If you really want an executable, here is a custom c program that I have used:

#include <windows.h>
#include <shellapi.h>
#include "resource.h"

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,LPTSTR    lpCmdLine, int  nCmdShow){
        ShellExecute(NULL,"open",".\\jre\\bin\\javaw.exe","-Xmx512m -cp ij.jar ij.ImageJ",NULL,SW_SHOWNORMAL);
        return 0;
}

Hope this helps,
Jay Unruh
Research Advisor
Stowers Institute for Medical Research

________________________________________
From: ImageJ Interest Group [[hidden email]] On Behalf Of Hoover, Karl [[hidden email]]
Sent: Friday, June 11, 2010 7:42 PM
To: [hidden email]
Subject: ImageJ.exe launcher on Windows x64?

Hi Wayne et al.,

I've got the Micromanager plugin and its components running fine on Windows 7 x64 but I still have an iron-resistant wrinkle with the ImageJ.exe launcher. We package ImageJ with Micromanager but we don't package Java. Therefore we let the ImageJ.exe launcher modify the ImageJ.cfg.  When ImageJ launches on an x64 machine with both 32 bit and 64 bit java machine installed  - the usual case -  it writes the path of the 32 bit java machine into the ImageJ.cfg irrespective of the value of JAVA_HOME.  Since Micromanager includes native (C++) binaries compiled for either Win32 or x64 we need to run on the appropriate java machine, else the results are quite unpleasant and will be quite bewildering to the end user. Has anyone else encountered this problem? Perhaps I'm missing something obvious?

Thanks in advance,

Karl Hoover