These notes were written by Vuokko-Helena Caseiro.
We wish to create an executable file for a given Java application. A Windows user with the Microsoft Virtual Machine (MS VM) installed, should be able to run such an executable file by for example clicking on the file's icon.
To see which version of the MS VM is installed, write "jview" in the dos window or look at the properties of the msjava.dll file in c:\windows\system (exception: under Windows 2000 "jview" doesn't work). The newest version of the MS VM may be found at http://www.microsoft.com/java/ (warning: it seems to be difficult or even impossible to uninstall the MS VM).
The executable file is created by using the jexegen tool from the Microsoft SDK for Java (MS SDK). One then needs to state all the class files to be bundled together. Unfortunately, it is only the old Java 1.1 API that is directly available.
I have tried the jexegen tools under Windows 98 and an older version of the MS VM (namely the 5.00.3167 which is also used by my Internet Explorer 5 to run applets). I installed the MS SDK version 4.0 (this version of the MS SDK doesn't include any MS VM but in other versions an MS VM might be included).
set path=%path%;c:\Programmi\"Microsoft SDK for Java 4.0"\bin
In the directory Microsoft SDK for Java 4.0/Docs one may read about the product:
This is done from the dos window by using the jexegen command. The class files are needed, obtained by compiling for example with Microsoft's jvc or Sun's java.
At the beginning of chapter 4 in Java the UML Way by Else Lervik and Vegard B. Havdal there is an example with a class Surface and a class FloorCalculations. By compilation I obtained two class files, Surface.class and FloorCalculations.class (it is not important what compilator is used).
In the dos window I placed myself in the directory where the two class files are located. Then I could create a file FloorCalculations.exe in the following way:
jexegen /v /main:FloorCalculations /out:FloorCalculations.exe Surface.class FloorCalculations.class
Explanation:
Assume that
In the dos window I placed myself in c:\. Then I could create a file Test.exe in the following way:
jexegen /v /main:Test /out:Test.exe /base:myPrograms/testProgram Test.class /base:myPackages myPackage/*.class
Explanation:
One may open a dos window, place oneself in the directory of the executable file and write the name of the executable file. Or one may click on the icon of the executable file; then a dos window is opened and then closed as soon as the program has been run (this is unfortunate for non-graphical programs that only use the dos window for print-out).
This is done from the dos window by using the jvc command. This command is used in the same way as the Sun javac command:
jvc FloorCalculations.java
This is done from the dos window by using the jview command. This command is used in the same way as the Sun java command:
jview FloorCalculations
From the control panel.