I was out tooling around on java.sun.com and I found this reply to a bulletin board posting:
...This solution works for the older JDK's (our application runs on JDK 1.1.8, though it should work with 1.02 or 1.2.x as well), and Windows 95/98/NT.
To install our Java application, we have the users copy a directory from a CD to their local drives. (You can also zip everything up into one zip file for distribution.) The directory has a bin and a lib subdirectory containing the jre. Also in the directory is a jar file containing all of the application's class files, and a batch file.
The user runs the program by double-clicking the batch file from Explorer. You can also make a shortcut of the batch file, and put it on the desktop or in the Start menu. Either way, the Java application runs WITHOUT an unneeded DOS frame! Here's how the batch file is set up to do its magic:
Contents of the 2-line run.bat:
@echo off
@start bin\jrew -classpath lib\classes.zip;.\myJarFile.jar MyMainClass
When you run the batch file, it briefly launches a DOS frame, which immediately completes its business and closes itself. The Java application appears shortly afterward in its own java.awt.Frame.
Notes: To get the DOS frame to disappear automatically in Windows 95/98, you MUST do the @echo off part. The DOS frame won't go
away if it's displaying any text. Windows NT doesn't have this problem.
The "start" command spawns the java application off in its own DOS interpreter. This allows the batch file to "keep on going", and finish up without waiting for our java application to terminate. Once the batch file is done, the DOS window is able to close on its own.
For those who don't know, jre.exe works essentially the same as java.exe for the purposes of running your Java program. jrew.exe works just like java.exe, too, but it doesn't spawn a new DOS window.
Since the batch file references the jre.exe and classes.zip that we ship along with the app, there is never any chance of conflicts with any JDK version the user might have already installed. Also, we don't make the user manually install the JDK or muck about with path settings. And, this batch file will work no matter where the user decides to install our application's directory. This is the perfect solution for those of us who have to distribute our programs to computer illiterates!
Hope this helps people!
-Kip Fiebig
www.kipley.com kip.fiebig@tivoli.com Credit where credit is due: Thanks for the info, Kip! It was exactly what I have been looking for.
------------------
���